mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
[improvement] optimize transition behavior (#500)
This commit is contained in:
parent
63bddbddfb
commit
be87ff828c
6
dist/behaviors/transition.js
vendored
6
dist/behaviors/transition.js
vendored
@ -1,8 +1,9 @@
|
|||||||
export default Behavior({
|
export default function(showDefaultValue) {
|
||||||
|
return Behavior({
|
||||||
properties: {
|
properties: {
|
||||||
customStyle: String,
|
customStyle: String,
|
||||||
show: {
|
show: {
|
||||||
value: true,
|
value: showDefaultValue,
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
observer(value) {
|
observer(value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
@ -50,3 +51,4 @@ export default Behavior({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
20
dist/popup/index.js
vendored
20
dist/popup/index.js
vendored
@ -5,28 +5,12 @@ Component({
|
|||||||
addGlobalClass: true
|
addGlobalClass: true
|
||||||
},
|
},
|
||||||
|
|
||||||
externalClasses: [
|
externalClasses: ['custom-class'],
|
||||||
'custom-class',
|
|
||||||
'overlay-class'
|
|
||||||
],
|
|
||||||
|
|
||||||
behaviors: [transitionBehaviors],
|
behaviors: [transitionBehaviors(false)],
|
||||||
|
|
||||||
properties: {
|
properties: {
|
||||||
overlayStyle: String,
|
overlayStyle: String,
|
||||||
show: {
|
|
||||||
value: false,
|
|
||||||
type: Boolean,
|
|
||||||
observer(value) {
|
|
||||||
if (value) {
|
|
||||||
this.show();
|
|
||||||
} else {
|
|
||||||
this.setData({
|
|
||||||
type: 'leave'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
overlay: {
|
overlay: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true
|
value: true
|
||||||
|
2
dist/transition/index.js
vendored
2
dist/transition/index.js
vendored
@ -7,7 +7,7 @@ Component({
|
|||||||
|
|
||||||
externalClasses: ['custom-class'],
|
externalClasses: ['custom-class'],
|
||||||
|
|
||||||
behaviors: [transitionBehaviors],
|
behaviors: [transitionBehaviors(true)],
|
||||||
|
|
||||||
properties: {
|
properties: {
|
||||||
name: {
|
name: {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
export default Behavior({
|
export default function(showDefaultValue) {
|
||||||
|
return Behavior({
|
||||||
properties: {
|
properties: {
|
||||||
customStyle: String,
|
customStyle: String,
|
||||||
show: {
|
show: {
|
||||||
value: true,
|
value: showDefaultValue,
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
observer(value) {
|
observer(value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
@ -50,3 +51,4 @@ export default Behavior({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
@ -5,28 +5,12 @@ Component({
|
|||||||
addGlobalClass: true
|
addGlobalClass: true
|
||||||
},
|
},
|
||||||
|
|
||||||
externalClasses: [
|
externalClasses: ['custom-class'],
|
||||||
'custom-class',
|
|
||||||
'overlay-class'
|
|
||||||
],
|
|
||||||
|
|
||||||
behaviors: [transitionBehaviors],
|
behaviors: [transitionBehaviors(false)],
|
||||||
|
|
||||||
properties: {
|
properties: {
|
||||||
overlayStyle: String,
|
overlayStyle: String,
|
||||||
show: {
|
|
||||||
value: false,
|
|
||||||
type: Boolean,
|
|
||||||
observer(value) {
|
|
||||||
if (value) {
|
|
||||||
this.show();
|
|
||||||
} else {
|
|
||||||
this.setData({
|
|
||||||
type: 'leave'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
overlay: {
|
overlay: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
value: true
|
value: true
|
||||||
|
@ -7,7 +7,7 @@ Component({
|
|||||||
|
|
||||||
externalClasses: ['custom-class'],
|
externalClasses: ['custom-class'],
|
||||||
|
|
||||||
behaviors: [transitionBehaviors],
|
behaviors: [transitionBehaviors(true)],
|
||||||
|
|
||||||
properties: {
|
properties: {
|
||||||
name: {
|
name: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user