elk/components/common/Dropdown.vue

18 lines
271 B
Vue
Raw Normal View History

2022-11-23 02:16:31 +00:00
<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>