1
0

chore(popup): trigger close function directly

This commit is contained in:
Dominik Pschenitschni 2024-07-15 18:37:55 +02:00 committed by konrad
parent a114b9c8d3
commit b718aa1fbd

View File

@ -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">