1
0
elk/components/common/CommonDropdown.vue
2022-11-23 10:22:18 +08:00

27 lines
386 B
Vue

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