feat(Dialog): add new prop transition

fix #954
This commit is contained in:
rex 2018-12-02 22:50:45 +08:00 committed by GitHub
parent 035a15c474
commit 10c54fc649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -138,6 +138,7 @@ Page({
| closeOnClickOverlay | 点击蒙层时是否关闭弹窗 | `Boolean` | `false` |
| asyncClose | 是否异步关闭弹窗,开启后需要手动控制弹窗的关闭 | `Boolean` | `false` |
| context | 选择器的选择范围,可以传入自定义组件的 this 作为上下文 | `Object` | 当前页面 |
| transition | 是否开启进场动画 | `Boolean` | `true` |
### API
@ -158,6 +159,7 @@ Page({
| close-on-click-overlay | 点击蒙层时是否关闭弹窗 | `Boolean` | `false` |
| use-slot | 是否使用自定义内容的插槽 | `Boolean` | `false` |
| async-close | 是否异步关闭弹窗,开启后需要手动控制弹窗的关闭 | `Boolean` | `false` |
| transition | 是否开启进场动画 | `Boolean` | `true` |
### Event

View File

@ -16,6 +16,7 @@ type DialogOptions = {
showCancelButton?: boolean;
closeOnClickOverlay?: boolean;
confirmButtonOpenType?: string;
transition?: boolean;
}
interface Dialog {
@ -68,7 +69,8 @@ Dialog.defaultOptions = {
showConfirmButton: true,
showCancelButton: false,
closeOnClickOverlay: false,
confirmButtonOpenType: ''
confirmButtonOpenType: '',
transition: true
};
Dialog.alert = options =>

View File

@ -32,6 +32,10 @@ VantComponent({
overlay: {
type: Boolean,
value: true
},
transition: {
type: Boolean,
value: true
}
},

View File

@ -1,6 +1,6 @@
<van-popup
show="{{ show }}"
transition="scale"
transition="{{ transition ? 'scale' : '' }}"
z-index="{{ zIndex }}"
overlay="{{ overlay }}"
custom-class="van-dialog"