mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2026-07-25 06:05:36 +08:00
Compare commits
No commits in common. "9130ebf59c8f9051b59025a7f8631d7ec4656e41" and "c0b7537da9aa1630252907489b8fdcd09f992d27" have entirely different histories.
9130ebf59c
...
c0b7537da9
13
dist/mixins/transition.js
vendored
13
dist/mixins/transition.js
vendored
@ -46,9 +46,7 @@ export function transition(showDefaultValue) {
|
||||
value ? this.enter() : this.leave();
|
||||
},
|
||||
enter() {
|
||||
if (this.enterFinishedPromise)
|
||||
return;
|
||||
this.enterFinishedPromise = new Promise((resolve) => {
|
||||
this.waitEnterEndPromise = new Promise((resolve) => {
|
||||
const { duration, name } = this.data;
|
||||
const classNames = getClassNames(name);
|
||||
const currentDuration = isObj(duration) ? duration.enter : duration;
|
||||
@ -80,9 +78,9 @@ export function transition(showDefaultValue) {
|
||||
});
|
||||
},
|
||||
leave() {
|
||||
if (!this.enterFinishedPromise)
|
||||
if (!this.waitEnterEndPromise)
|
||||
return;
|
||||
this.enterFinishedPromise.then(() => {
|
||||
this.waitEnterEndPromise.then(() => {
|
||||
if (!this.data.display) {
|
||||
return;
|
||||
}
|
||||
@ -105,10 +103,7 @@ export function transition(showDefaultValue) {
|
||||
return;
|
||||
}
|
||||
this.transitionEnded = false;
|
||||
setTimeout(() => {
|
||||
this.onTransitionEnd();
|
||||
this.enterFinishedPromise = null;
|
||||
}, currentDuration);
|
||||
setTimeout(() => this.onTransitionEnd(), currentDuration);
|
||||
this.setData({ classes: classNames['leave-to'] });
|
||||
});
|
||||
});
|
||||
|
||||
@ -50,9 +50,7 @@ function transition(showDefaultValue) {
|
||||
},
|
||||
enter: function () {
|
||||
var _this = this;
|
||||
if (this.enterFinishedPromise)
|
||||
return;
|
||||
this.enterFinishedPromise = new Promise(function (resolve) {
|
||||
this.waitEnterEndPromise = 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;
|
||||
@ -85,9 +83,9 @@ function transition(showDefaultValue) {
|
||||
},
|
||||
leave: function () {
|
||||
var _this = this;
|
||||
if (!this.enterFinishedPromise)
|
||||
if (!this.waitEnterEndPromise)
|
||||
return;
|
||||
this.enterFinishedPromise.then(function () {
|
||||
this.waitEnterEndPromise.then(function () {
|
||||
if (!_this.data.display) {
|
||||
return;
|
||||
}
|
||||
@ -110,10 +108,7 @@ function transition(showDefaultValue) {
|
||||
return;
|
||||
}
|
||||
_this.transitionEnded = false;
|
||||
setTimeout(function () {
|
||||
_this.onTransitionEnd();
|
||||
_this.enterFinishedPromise = null;
|
||||
}, currentDuration);
|
||||
setTimeout(function () { return _this.onTransitionEnd(); }, currentDuration);
|
||||
_this.setData({ classes: classNames['leave-to'] });
|
||||
});
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vant/weapp",
|
||||
"version": "1.11.4-beta.0",
|
||||
"version": "1.11.3",
|
||||
"author": "vant-ui",
|
||||
"license": "MIT",
|
||||
"miniprogram": "lib",
|
||||
|
||||
@ -53,8 +53,7 @@ export function transition(showDefaultValue: boolean) {
|
||||
},
|
||||
|
||||
enter() {
|
||||
if (this.enterFinishedPromise) return;
|
||||
this.enterFinishedPromise = new Promise((resolve) => {
|
||||
this.waitEnterEndPromise = new Promise((resolve) => {
|
||||
const { duration, name } = this.data;
|
||||
const classNames = getClassNames(name);
|
||||
const currentDuration = isObj(duration) ? duration.enter : duration;
|
||||
@ -94,8 +93,8 @@ export function transition(showDefaultValue: boolean) {
|
||||
},
|
||||
|
||||
leave() {
|
||||
if (!this.enterFinishedPromise) return;
|
||||
this.enterFinishedPromise.then(() => {
|
||||
if (!this.waitEnterEndPromise) return;
|
||||
this.waitEnterEndPromise.then(() => {
|
||||
if (!this.data.display) {
|
||||
return;
|
||||
}
|
||||
@ -125,10 +124,7 @@ export function transition(showDefaultValue: boolean) {
|
||||
}
|
||||
|
||||
this.transitionEnded = false;
|
||||
setTimeout(() => {
|
||||
this.onTransitionEnd();
|
||||
this.enterFinishedPromise = null;
|
||||
}, currentDuration);
|
||||
setTimeout(() => this.onTransitionEnd(), currentDuration);
|
||||
|
||||
this.setData({ classes: classNames['leave-to'] });
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user