1
0
mirror of https://github.com/elk-zone/elk synced 2025-01-10 01:19:29 +09:00
elk/components/common/CommonDropdown.vue

27 lines
386 B
Vue
Raw Normal View History

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