1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-19 15:29:59 +00:00
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>