fix(ui): close modals when navigating (#253)
This commit is contained in:
parent
fc38c339a6
commit
1039c225e9
|
@ -78,6 +78,8 @@ useEventListener('keydown', (e: KeyboardEvent) => {
|
|||
}
|
||||
})
|
||||
|
||||
let unsubscribe: () => void
|
||||
|
||||
watch(modelValue, async (v) => {
|
||||
if (v) {
|
||||
isOut = true
|
||||
|
@ -85,8 +87,14 @@ watch(modelValue, async (v) => {
|
|||
setTimeout(() => {
|
||||
isOut = false
|
||||
}, 10)
|
||||
|
||||
unsubscribe = useRouter().beforeEach(() => {
|
||||
unsubscribe()
|
||||
close()
|
||||
})
|
||||
}
|
||||
else {
|
||||
unsubscribe?.()
|
||||
isOut = true
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue