NewbieModal

弹窗组件 可以选择使用 Modal 或者是 Drawer Modal 支持全屏以及拖动

Version: 1.0.0

Props

Prop nameDescriptionTypeValuesDefault
type弹窗类型stringmodal, drawer"modal"
visible可见性控制
v-model:visible
boolean-false
width宽度number|string-800
height高度,仅当 Type 为 modal 时有效number|string-500
title标题string-""
beforeCloseFunction 时返回 Promise, resolve(true) 正常关闭,resolve(false) 可阻止关闭;
Object 时参考 下方配置 beforeclose
func|object-null
modalProps原生 Modalopen in new window 或者是 Draweropen in new window 的配置object-{}

Events

Event namePropertiesDescription
update:visiblevisible boolean - 是否可见
close关闭弹窗时回调

详细参数

beforeClose

Prop nameDescriptionTypeValuesDefault
titleModal 提示框的 titlestring-""
contentModal 提示框的内容string-""
okText确认按钮的文字string-"确定"
cancelText取消按钮的文字string-"取消"
trigger是否出现提示框func | boolean-false

示例


<Button @click="modalVisible = true" type="primary">弹出Modal</Button>
<NewbieModal v-model:visible="modalVisible" title="这里是标题">这里是内容</NewbieModal>

<Button @click="drawerVisible = true" type="primary" style="margin-top: 20px;">弹出Drawer</Button>
<NewbieModal v-model:visible="drawerVisible" type="drawer" title="这里是标题">这里是内容</NewbieModal>
Last Updated:
Contributors: sinceow