forked from FoundKeyGang/FoundKey
* seqent fix
* comment
* ✌️
This commit is contained in:
parent
2068407be0
commit
4ab38b7894
1 changed files with 16 additions and 9 deletions
|
@ -40,22 +40,29 @@ export default Vue.extend({
|
||||||
i: 0,
|
i: 0,
|
||||||
methods: {
|
methods: {
|
||||||
beforeEnter(el) {
|
beforeEnter(el) {
|
||||||
|
if (document.hidden) return;
|
||||||
|
|
||||||
el.style.opacity = 0;
|
el.style.opacity = 0;
|
||||||
el.style.transform = this.direction === 'down' ? 'translateY(-64px)' : 'translateY(64px)';
|
el.style.transform = this.direction === 'down' ? 'translateY(-64px)' : 'translateY(64px)';
|
||||||
let index = this.$options.i;
|
const delay = this.delay * this.$options.i;
|
||||||
const delay = this.delay * index;
|
|
||||||
el.style.transition = [getComputedStyle(el).transition, `transform 0.7s cubic-bezier(0.23, 1, 0.32, 1) ${delay}ms`, `opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1) ${delay}ms`].filter(x => x != '').join(',');
|
el.style.transition = [getComputedStyle(el).transition, `transform 0.7s cubic-bezier(0.23, 1, 0.32, 1) ${delay}ms`, `opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1) ${delay}ms`].filter(x => x != '').join(',');
|
||||||
this.$options.i++;
|
this.$options.i++;
|
||||||
},
|
|
||||||
enter(el, done) {
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
el.style.transition = '';
|
||||||
|
this.$options.i--;
|
||||||
|
}, delay + 710);
|
||||||
|
},
|
||||||
|
enter(el) {
|
||||||
|
if (document.hidden) {
|
||||||
|
el.style.opacity = 1;
|
||||||
|
el.style.transform = 'translateY(0px)';
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
setTimeout(() => { // 必要
|
||||||
el.style.opacity = 1;
|
el.style.opacity = 1;
|
||||||
el.style.transform = 'translateY(0px)';
|
el.style.transform = 'translateY(0px)';
|
||||||
el.addEventListener('transitionend', () => {
|
|
||||||
el.style.transition = '';
|
|
||||||
this.$options.i--;
|
|
||||||
done();
|
|
||||||
}, { once: true });
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
leave(el) {
|
leave(el) {
|
||||||
|
|
Loading…
Reference in a new issue