Skip to content

Overlay

基础用法

html

<pa-button @click="onVisibleChange()">显示遮罩层</pa-button>

<pa-overlay :show="visible" @click="onVisibleChange(false)" />
ts

import { ref } from 'vue'
const visible = ref(false)

const onVisibleChange = (show = true) => {
  visible.value = show
}

嵌入内容

html

<pa-button @click="onVisibleChange()">嵌入内容</pa-button>

<pa-overlay :show="visible" @click="onVisibleChange(false)">
  <view class="flex items-center justify-center height-full">
    <view style="width: 200px; height: 200px; background-color: #fff"></view>
  </view>
</pa-overlay>
ts

import { ref } from 'vue'
const visible = ref(false)

const onVisibleChange = (show = true) => {
  visible.value = show
}

Overlay Props

参数说明类型默认值
show是否展示遮罩层boolean-
zIndexz-index 层级number1
duration动画时长,单位毫秒-
customClass自定义classstring-
customStyle自定义styleCSSProperties-

Overlay Event

事件名参数
click()

Overlay Slot

名称说明
default-

样式变量

🙈