mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-21 22:41:05 +08:00
16 lines
401 B
TypeScript
16 lines
401 B
TypeScript
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
|
|
}
|