build: compile 1.11.4-beta.0

This commit is contained in:
landluck 2024-01-22 19:31:58 +08:00
parent b9f88ec64a
commit cdb692fbec
2 changed files with 18 additions and 8 deletions

View File

@ -46,7 +46,9 @@ export function transition(showDefaultValue) {
value ? this.enter() : this.leave();
},
enter() {
this.waitEnterEndPromise = new Promise((resolve) => {
if (this.enterFinishedPromise)
return;
this.enterFinishedPromise = new Promise((resolve) => {
const { duration, name } = this.data;
const classNames = getClassNames(name);
const currentDuration = isObj(duration) ? duration.enter : duration;
@ -78,9 +80,9 @@ export function transition(showDefaultValue) {
});
},
leave() {
if (!this.waitEnterEndPromise)
if (!this.enterFinishedPromise)
return;
this.waitEnterEndPromise.then(() => {
this.enterFinishedPromise.then(() => {
if (!this.data.display) {
return;
}
@ -103,7 +105,10 @@ export function transition(showDefaultValue) {
return;
}
this.transitionEnded = false;
setTimeout(() => this.onTransitionEnd(), currentDuration);
setTimeout(() => {
this.onTransitionEnd();
this.enterFinishedPromise = null;
}, currentDuration);
this.setData({ classes: classNames['leave-to'] });
});
});

View File

@ -50,7 +50,9 @@ function transition(showDefaultValue) {
},
enter: function () {
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 classNames = getClassNames(name);
var currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
@ -83,9 +85,9 @@ function transition(showDefaultValue) {
},
leave: function () {
var _this = this;
if (!this.waitEnterEndPromise)
if (!this.enterFinishedPromise)
return;
this.waitEnterEndPromise.then(function () {
this.enterFinishedPromise.then(function () {
if (!_this.data.display) {
return;
}
@ -108,7 +110,10 @@ function transition(showDefaultValue) {
return;
}
_this.transitionEnded = false;
setTimeout(function () { return _this.onTransitionEnd(); }, currentDuration);
setTimeout(function () {
_this.onTransitionEnd();
_this.enterFinishedPromise = null;
}, currentDuration);
_this.setData({ classes: classNames['leave-to'] });
});
});