<template>
  <div class="dialog">
    <div class="masker" @click="close"></div>
    <slot />
  </div>
</template>

<script setup>
const emits = defineEmits(['close'])

function close() {
  emits('close')
}
</script>

<style lang="scss" scoped>
.dialog {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.6);
  animation-duration: 0.2s;
}
.masker {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
}
</style>
