mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[improvement] Dialog: optimize transition prop (#1000)
This commit is contained in:
parent
c25654d153
commit
7a0de4d6bd
@ -138,7 +138,7 @@ Page({
|
|||||||
| closeOnClickOverlay | 点击蒙层时是否关闭弹窗 | `Boolean` | `false` |
|
| closeOnClickOverlay | 点击蒙层时是否关闭弹窗 | `Boolean` | `false` |
|
||||||
| asyncClose | 是否异步关闭弹窗,开启后需要手动控制弹窗的关闭 | `Boolean` | `false` |
|
| asyncClose | 是否异步关闭弹窗,开启后需要手动控制弹窗的关闭 | `Boolean` | `false` |
|
||||||
| context | 选择器的选择范围,可以传入自定义组件的 this 作为上下文 | `Object` | 当前页面 |
|
| context | 选择器的选择范围,可以传入自定义组件的 this 作为上下文 | `Object` | 当前页面 |
|
||||||
| transition | 是否开启进场动画 | `Boolean` | `true` |
|
| transition | 动画名称,可选值为`fade` | `String` | `scale` |
|
||||||
|
|
||||||
### API
|
### API
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ Page({
|
|||||||
| close-on-click-overlay | 点击蒙层时是否关闭弹窗 | `Boolean` | `false` |
|
| close-on-click-overlay | 点击蒙层时是否关闭弹窗 | `Boolean` | `false` |
|
||||||
| use-slot | 是否使用自定义内容的插槽 | `Boolean` | `false` |
|
| use-slot | 是否使用自定义内容的插槽 | `Boolean` | `false` |
|
||||||
| async-close | 是否异步关闭弹窗,开启后需要手动控制弹窗的关闭 | `Boolean` | `false` |
|
| async-close | 是否异步关闭弹窗,开启后需要手动控制弹窗的关闭 | `Boolean` | `false` |
|
||||||
| transition | 是否开启进场动画 | `Boolean` | `true` |
|
| transition | 动画名称,可选值为`fade` | `String` | `scale` |
|
||||||
|
|
||||||
### Event
|
### Event
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ type DialogOptions = {
|
|||||||
message?: string;
|
message?: string;
|
||||||
overlay?: boolean;
|
overlay?: boolean;
|
||||||
selector?: string;
|
selector?: string;
|
||||||
|
transition?: string;
|
||||||
asyncClose?: boolean;
|
asyncClose?: boolean;
|
||||||
confirmButtonText?: string;
|
confirmButtonText?: string;
|
||||||
cancelButtonText?: string;
|
cancelButtonText?: string;
|
||||||
@ -16,7 +17,6 @@ type DialogOptions = {
|
|||||||
showCancelButton?: boolean;
|
showCancelButton?: boolean;
|
||||||
closeOnClickOverlay?: boolean;
|
closeOnClickOverlay?: boolean;
|
||||||
confirmButtonOpenType?: string;
|
confirmButtonOpenType?: string;
|
||||||
transition?: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Dialog {
|
interface Dialog {
|
||||||
@ -68,14 +68,14 @@ Dialog.defaultOptions = {
|
|||||||
zIndex: 100,
|
zIndex: 100,
|
||||||
overlay: true,
|
overlay: true,
|
||||||
asyncClose: false,
|
asyncClose: false,
|
||||||
|
transition: 'scale',
|
||||||
selector: '#van-dialog',
|
selector: '#van-dialog',
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
showConfirmButton: true,
|
showConfirmButton: true,
|
||||||
showCancelButton: false,
|
showCancelButton: false,
|
||||||
closeOnClickOverlay: false,
|
closeOnClickOverlay: false,
|
||||||
confirmButtonOpenType: '',
|
confirmButtonOpenType: ''
|
||||||
transition: true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Dialog.alert = Dialog;
|
Dialog.alert = Dialog;
|
||||||
|
@ -34,8 +34,8 @@ VantComponent({
|
|||||||
value: true
|
value: true
|
||||||
},
|
},
|
||||||
transition: {
|
transition: {
|
||||||
type: Boolean,
|
type: String,
|
||||||
value: true
|
value: 'scale'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<van-popup
|
<van-popup
|
||||||
show="{{ show }}"
|
show="{{ show }}"
|
||||||
transition="{{ transition ? 'scale' : '' }}"
|
|
||||||
z-index="{{ zIndex }}"
|
z-index="{{ zIndex }}"
|
||||||
overlay="{{ overlay }}"
|
overlay="{{ overlay }}"
|
||||||
custom-class="van-dialog"
|
custom-class="van-dialog"
|
||||||
|
transition="{{ transition }}"
|
||||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||||
bind:close="onClickOverlay"
|
bind:close="onClickOverlay"
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user