1
0
mirror of https://github.com/elk-zone/elk synced 2024-11-24 15:16:09 +09:00
elk/components/modal/ModalDialog.vue

30 lines
759 B
Vue
Raw Normal View History

2022-11-23 12:48:01 +09:00
<script setup lang='ts'>
const { modelValue } = defineModel<{
modelValue: boolean
}>()
</script>
<template>
<div
class="fixed top-0 bottom-0 left-0 right-0 z-60"
:class="modelValue ? '' : 'pointer-events-none'"
>
<div
class="
bg-base bottom-0 left-0 right-0 top-0 absolute transition-opacity duration-500 ease-out
"
:class="modelValue ? 'opacity-85' : 'opacity-0'"
@click="modelValue = false"
/>
<div
class="
bg-base absolute transition-all duration-200 ease-out shadow rounded-md transform
border border-base left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2
"
:class="modelValue ? 'opacity-100' : 'opacity-0'"
>
<slot />
</div>
</div>
</template>