mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[improvement] Dialog: support confirm button open type (#518)
This commit is contained in:
parent
18811373b5
commit
47a606416a
3
dist/dialog/dialog.js
vendored
3
dist/dialog/dialog.js
vendored
@ -30,7 +30,8 @@ Dialog.defaultOptions = {
|
||||
cancelButtonText: '取消',
|
||||
showConfirmButton: true,
|
||||
showCancelButton: false,
|
||||
closeOnClickOverlay: false
|
||||
closeOnClickOverlay: false,
|
||||
confirmButtonOpenType: ''
|
||||
};
|
||||
|
||||
Dialog.alert = options =>
|
||||
|
1
dist/dialog/index.js
vendored
1
dist/dialog/index.js
vendored
@ -9,6 +9,7 @@ Component({
|
||||
useSlot: Boolean,
|
||||
asyncClose: Boolean,
|
||||
showCancelButton: Boolean,
|
||||
confirmButtonOpenType: String,
|
||||
show: {
|
||||
type: Boolean,
|
||||
observer(show) {
|
||||
|
1
dist/dialog/index.wxml
vendored
1
dist/dialog/index.wxml
vendored
@ -33,6 +33,7 @@
|
||||
size="large"
|
||||
loading="{{ loading.confirm }}"
|
||||
custom-class="van-dialog__confirm"
|
||||
open-type="{{ confirmButtonOpenType }}"
|
||||
bind:click="onConfirm"
|
||||
>
|
||||
{{ confirmButtonText }}
|
||||
|
@ -129,9 +129,10 @@ Page({
|
||||
| showCancelButton | 是否展示取消按钮 | `Boolean` | `false` |
|
||||
| confirmButtonText | 确认按钮的文案 | `String` | `确认` |
|
||||
| cancelButtonText | 取消按钮的文案 | `String` | `取消` |
|
||||
| confirmButtonOpenType | 确认按钮的微信开放能力,具体支持可参考 [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/component/button.html) | `String` | - |
|
||||
| overlay | 是否展示蒙层 | `Boolean` | `true` |
|
||||
| closeOnClickOverlay | 点击蒙层时是否关闭弹窗 | `Boolean` | `false` |
|
||||
| async-close | 是否异步关闭弹窗,开启后需要手动控制弹窗的关闭 | `Boolean` | `false` |
|
||||
| asyncClose | 是否异步关闭弹窗,开启后需要手动控制弹窗的关闭 | `Boolean` | `false` |
|
||||
|
||||
### API
|
||||
|
||||
@ -146,6 +147,7 @@ Page({
|
||||
| show-cancel-button | 是否展示取消按钮 | `Boolean` | `false` |
|
||||
| confirm-button-text | 确认按钮的文案 | `String` | `确认` |
|
||||
| cancel-button-text | 取消按钮的文案 | `String` | `取消` |
|
||||
| confirm-button-open-type | 确认按钮的微信开放能力,具体支持可参考 [微信官方文档](https://mp.weixin.qq.com/debug/wxadoc/dev/component/button.html) | `String` | - |
|
||||
| overlay | 是否展示蒙层 | `Boolean` | `true` |
|
||||
| close-on-click-overlay | 点击蒙层时是否关闭弹窗 | `Boolean` | `false` |
|
||||
| use-slot | 是否使用自定义内容的插槽 | `Boolean` | `false` |
|
||||
|
@ -30,7 +30,8 @@ Dialog.defaultOptions = {
|
||||
cancelButtonText: '取消',
|
||||
showConfirmButton: true,
|
||||
showCancelButton: false,
|
||||
closeOnClickOverlay: false
|
||||
closeOnClickOverlay: false,
|
||||
confirmButtonOpenType: ''
|
||||
};
|
||||
|
||||
Dialog.alert = options =>
|
||||
|
@ -9,6 +9,7 @@ Component({
|
||||
useSlot: Boolean,
|
||||
asyncClose: Boolean,
|
||||
showCancelButton: Boolean,
|
||||
confirmButtonOpenType: String,
|
||||
show: {
|
||||
type: Boolean,
|
||||
observer(show) {
|
||||
|
@ -33,6 +33,7 @@
|
||||
size="large"
|
||||
loading="{{ loading.confirm }}"
|
||||
custom-class="van-dialog__confirm"
|
||||
open-type="{{ confirmButtonOpenType }}"
|
||||
bind:click="onConfirm"
|
||||
>
|
||||
{{ confirmButtonText }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user