1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-03 07:29:59 +00:00
elk/components/common/CommonDropdown.vue

27 lines
386 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, () => {
2022-11-23 02:22:18 +00:00
if (modelValue)
modelValue.value = false
2022-11-23 02:16:31 +00:00
})
</script>
<template>
2022-11-23 02:22:18 +00:00
<div
v-show="modelValue"
ref="el"
absolute
bg-base
rounded
shadow-xl
dark="border border-base"
>
2022-11-23 02:16:31 +00:00
<slot />
</div>
</template>