docs(Dialog): update demo (#7007)

This commit is contained in:
neverland
2020-08-14 20:27:02 +08:00
committed by GitHub
parent 4f9eeec752
commit b6e42d2344
4 changed files with 80 additions and 101 deletions
+17 -17
View File
@@ -56,6 +56,23 @@ Dialog.alert({
});
```
### 消息确认
用于确认消息,包含取消和确认按钮。
```js
Dialog.confirm({
title: '标题',
message: '弹窗内容',
})
.then(() => {
// on confirm
})
.catch(() => {
// on cancel
});
```
### 圆角按钮风格
将 theme 选项设置为 `round-button` 可以展示圆角按钮风格的弹窗,该选项从 2.10.0 版本开始支持。
@@ -77,23 +94,6 @@ Dialog.alert({
});
```
### 消息确认
用于确认消息,包含取消和确认按钮。
```js
Dialog.confirm({
title: '标题',
message: '弹窗内容',
})
.then(() => {
// on confirm
})
.catch(() => {
// on cancel
});
```
### 异步关闭
通过 `beforeClose` 属性可以传入一个回调函数,在弹窗关闭前进行特定操作。