mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-07 01:19:57 +00:00
fix(ui): close modals when navigating (#253)
This commit is contained in:
parent
fc38c339a6
commit
1039c225e9
1 changed files with 8 additions and 0 deletions
|
@ -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