chore(popup): trigger close function directly
This commit is contained in:
parent
a114b9c8d3
commit
b718aa1fbd
@ -57,6 +57,9 @@ watchEffect(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
|
if (!openValue.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
openValue.value = false
|
openValue.value = false
|
||||||
emit('update:open', false)
|
emit('update:open', false)
|
||||||
}
|
}
|
||||||
@ -69,12 +72,7 @@ function toggle() {
|
|||||||
|
|
||||||
const popup = ref<HTMLElement | null>(null)
|
const popup = ref<HTMLElement | null>(null)
|
||||||
|
|
||||||
onClickOutside(popup, () => {
|
onClickOutside(popup, () => close())
|
||||||
if (!openValue.value) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
close()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user