elk/components/common/Dropdown.vue
2022-11-23 10:16:31 +08:00

18 lines
271 B
Vue

<script setup lang="ts">
const { modelValue } = defineModel<{
modelValue: boolean
}>()
const el = ref<HTMLDivElement>()
onClickOutside(el, () => {
modelValue.value = false
})
</script>
<template>
<div ref="el" absolute bg-base>
<slot />
</div>
</template>