mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-02 10:00:54 +08:00
feat: add message float components
This commit is contained in:
15
frontend_nuxt/composables/useMessageFloat.ts
Normal file
15
frontend_nuxt/composables/useMessageFloat.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export const useMessageFloat = () =>
|
||||
useState<{ open: boolean; path: string }>('message-float', () => ({
|
||||
open: false,
|
||||
path: '/message-box',
|
||||
}))
|
||||
export const openMessageFloat = (path: string) => {
|
||||
const state = useMessageFloat()
|
||||
state.value.open = true
|
||||
state.value.path = path
|
||||
}
|
||||
|
||||
export const closeMessageFloat = () => {
|
||||
const state = useMessageFloat()
|
||||
state.value.open = false
|
||||
}
|
||||
Reference in New Issue
Block a user