Skip to content

Overlay 遮罩层

Transition 动画

html
<vz-button block @click="handleShowTransition">Transition 动画</vz-button>

<vz-overlay v-model:show="isShowTransition" closeable></vz-overlay>
typescript
import { ref } from "vue";

const isShowTransition = ref(false);
function handleShowTransition() {
  isShowTransition.value = true;
}

Animation 动画

html
<vz-button block @click="handleShowAnimation">Animation 动画</vz-button>

<vz-overlay v-model:show="isShowAnimation" animation closeable></vz-overlay>
typescript
import { ref } from "vue";

const isShowAnimation = ref(false);
function handleShowAnimation() {
  isShowAnimation.value = true;
}

Props

属性名说明类型默认值样式变量
v-model:show是否显示遮罩层booleanfalse-
z-indexz-indexnumber / stringcalc(var(--vz-z-index) + 100)--vz-overlay-z-index
toptopstring / number0--vz-overlay-top
bottombottomstring / number0--vz-overlay-bottom
leftleftstring / number0--vz-overlay-left
rightrightstring / number0--vz-overlay-right
closeable点击是否可关闭booleanfalse-
background背景stringrgba(0, 0, 0, 0.6)--vz-overlay-background
animation是否使用 animation 动画booleanfalse-
duration动画时长(设置为 0 可关闭动画)。单位 msnumber250-
i-class根节点样式类string--
i-style根节点样式Vue.StyleValue--

Events

事件名说明参数
click点击事件-

Slots

插槽名说明
default默认插槽

SCSS

scss
$overlay: (
  "z-index": calc(var(--vz-z-index) + 100)),
  "background": rgba(0, 0, 0, 0.6),
);