<template>
  <view class="mask" v-if="show" @click="isShowFn">
    <slot></slot>
  </view>
</template>

<script setup lang="ts">
defineProps({
  show: {
    type: Boolean,
    default: false,
  },
})

const emits = defineEmits(['isShow'])

const isShowFn = () => {
  emits('isShow')
}
</script>

<style lang="scss">
.mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
}
</style>
