mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
docs(dialog): add xml for all example (#3877)
This commit is contained in:
parent
c088113714
commit
68f8b4e0ee
@ -47,7 +47,13 @@ Dialog.alert({
|
||||
|
||||
用于确认消息,包含取消和确认按钮
|
||||
|
||||
```html
|
||||
<van-dialog id="van-dialog" />
|
||||
```
|
||||
|
||||
```javascript
|
||||
import Dialog from 'path/to/@vant/weapp/dist/dialog/dialog';
|
||||
|
||||
Dialog.confirm({
|
||||
title: '标题',
|
||||
message: '弹窗内容',
|
||||
@ -91,7 +97,13 @@ Dialog.alert({
|
||||
|
||||
通过 `beforeClose` 属性可以传入一个回调函数,在弹窗关闭前进行特定操作。
|
||||
|
||||
```html
|
||||
<van-dialog id="van-dialog" />
|
||||
```
|
||||
|
||||
```javascript
|
||||
import Dialog from 'path/to/@vant/weapp/dist/dialog/dialog';
|
||||
|
||||
const beforeClose = (action) => new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
if (action === 'confirm') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user