Skip to content

Dialog 对话框

Dialog 对话框打开
9:41
/pages/dialog/index

介绍

weui-dialog 用于确认、提醒、二次确认等强反馈场景,支持单按钮、双按钮、警示按钮和自定义内容。

基础用法

vue
<template>
  <weui-button text="打开弹窗" @click="visible = true" />
  <weui-dialog
    v-model="visible"
    title="弹窗标题"
    content="弹窗内容,告知当前状态、信息和解决方法。"
  />
</template>

自定义内容

vue
<weui-dialog v-model="visible" title="确认操作">
  这里可以放自定义内容。
</weui-dialog>

Props

属性说明类型默认值
modelValue是否显示弹窗,支持 v-modelbooleanfalse
title标题string''
content内容string''
cancelText取消按钮文字string'辅助操作'
confirmText确认按钮文字string'主操作'
confirmType确认按钮类型,可选 primarywarndefaultstring'primary'
showCancel是否显示取消按钮booleantrue
buttonWrap按钮是否换行排列booleanfalse
maskClosable点击遮罩是否关闭booleanfalse

Slots

插槽名说明
default自定义内容
title自定义标题

Events

事件名说明
update:modelValue显示状态变化
cancel点击取消按钮
confirm点击确认按钮
close弹窗关闭

Released under the MIT License.