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>
|