mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
build: compile 1.11.4-beta.0
This commit is contained in:
parent
b9f88ec64a
commit
cdb692fbec
13
dist/mixins/transition.js
vendored
13
dist/mixins/transition.js
vendored
@ -46,7 +46,9 @@ export function transition(showDefaultValue) {
|
|||||||
value ? this.enter() : this.leave();
|
value ? this.enter() : this.leave();
|
||||||
},
|
},
|
||||||
enter() {
|
enter() {
|
||||||
this.waitEnterEndPromise = new Promise((resolve) => {
|
if (this.enterFinishedPromise)
|
||||||
|
return;
|
||||||
|
this.enterFinishedPromise = new Promise((resolve) => {
|
||||||
const { duration, name } = this.data;
|
const { duration, name } = this.data;
|
||||||
const classNames = getClassNames(name);
|
const classNames = getClassNames(name);
|
||||||
const currentDuration = isObj(duration) ? duration.enter : duration;
|
const currentDuration = isObj(duration) ? duration.enter : duration;
|
||||||
@ -78,9 +80,9 @@ export function transition(showDefaultValue) {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
leave() {
|
leave() {
|
||||||
if (!this.waitEnterEndPromise)
|
if (!this.enterFinishedPromise)
|
||||||
return;
|
return;
|
||||||
this.waitEnterEndPromise.then(() => {
|
this.enterFinishedPromise.then(() => {
|
||||||
if (!this.data.display) {
|
if (!this.data.display) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -103,7 +105,10 @@ export function transition(showDefaultValue) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.transitionEnded = false;
|
this.transitionEnded = false;
|
||||||
setTimeout(() => this.onTransitionEnd(), currentDuration);
|
setTimeout(() => {
|
||||||
|
this.onTransitionEnd();
|
||||||
|
this.enterFinishedPromise = null;
|
||||||
|
}, currentDuration);
|
||||||
this.setData({ classes: classNames['leave-to'] });
|
this.setData({ classes: classNames['leave-to'] });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -50,7 +50,9 @@ function transition(showDefaultValue) {
|
|||||||
},
|
},
|
||||||
enter: function () {
|
enter: function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
this.waitEnterEndPromise = new Promise(function (resolve) {
|
if (this.enterFinishedPromise)
|
||||||
|
return;
|
||||||
|
this.enterFinishedPromise = new Promise(function (resolve) {
|
||||||
var _a = _this.data, duration = _a.duration, name = _a.name;
|
var _a = _this.data, duration = _a.duration, name = _a.name;
|
||||||
var classNames = getClassNames(name);
|
var classNames = getClassNames(name);
|
||||||
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
|
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
|
||||||
@ -83,9 +85,9 @@ function transition(showDefaultValue) {
|
|||||||
},
|
},
|
||||||
leave: function () {
|
leave: function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
if (!this.waitEnterEndPromise)
|
if (!this.enterFinishedPromise)
|
||||||
return;
|
return;
|
||||||
this.waitEnterEndPromise.then(function () {
|
this.enterFinishedPromise.then(function () {
|
||||||
if (!_this.data.display) {
|
if (!_this.data.display) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -108,7 +110,10 @@ function transition(showDefaultValue) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_this.transitionEnded = false;
|
_this.transitionEnded = false;
|
||||||
setTimeout(function () { return _this.onTransitionEnd(); }, currentDuration);
|
setTimeout(function () {
|
||||||
|
_this.onTransitionEnd();
|
||||||
|
_this.enterFinishedPromise = null;
|
||||||
|
}, currentDuration);
|
||||||
_this.setData({ classes: classNames['leave-to'] });
|
_this.setData({ classes: classNames['leave-to'] });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user