elk/components/common/CommonDropdown.vue

27 lines
386 B
Vue
Raw Normal View History

2022-11-23 03:16:31 +01:00
<script setup lang="ts">
const { modelValue } = defineModel<{
modelValue: boolean
}>()
const el = ref<HTMLDivElement>()
onClickOutside(el, () => {
2022-11-23 03:22:18 +01:00
if (modelValue)
modelValue.value = false
2022-11-23 03:16:31 +01:00
})
</script>
<template>
2022-11-23 03:22:18 +01:00
<div
v-show="modelValue"
ref="el"
absolute
bg-base
rounded
shadow-xl
dark="border border-base"
>
2022-11-23 03:16:31 +01:00
<slot />
</div>
</template>