Skip to content

Overlay 遮罩层

基础用法

html
<script setup lang="ts">
import { ref } from 'vue'
const show = ref(false)
</script>

<template>
  <AOverlay :show="show" />
  <AButton @click="show = true">展示遮罩层</AButton>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const show = ref(false)
</script>

<template>
  <AOverlay :show="show" />
  <AButton @click="show = true">展示遮罩层</AButton>
</template>

嵌入内容

html
<template>
  <AOverlay :show="show">
    <div class="h-full flex items-center justify-center">
      <div class="h-20 bg-white w-20" @click.stop />
    </div>
  </AOverlay>
  <AButton @click="show = true">展示遮罩层</AButton>
</template>
<template>
  <AOverlay :show="show">
    <div class="h-full flex items-center justify-center">
      <div class="h-20 bg-white w-20" @click.stop />
    </div>
  </AOverlay>
  <AButton @click="show = true">展示遮罩层</AButton>
</template>

API

Props

参数说明类型默认值
show是否展示遮罩层booleanfalse
duration动画时长,单位为毫秒number200

Events

事件名说明回调参数
click点击遮罩层时触发-

Slots

名称说明
default自定义内容

MIT Licensed