N
Nuxt11mo ago
Werdox

Layout transition with javascript hook not working

I wanted to animate between layouts using anime.js. But it seems that the layout transition javascript hook doesn't even care about when the done() function is called and just immediately changes the layout. here is my code:
definePageMeta({
layout: "main",
layoutTransition: {
mode: "in-out",
onEnter(el, done) {
new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, 5000);
}).then(() => done());
},
},
});
definePageMeta({
layout: "main",
layoutTransition: {
mode: "in-out",
onEnter(el, done) {
new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, 5000);
}).then(() => done());
},
},
});
here I'm just creating a promise that when done, with call the done function. i tried to await it; tried using just setTimeout; nothing worked!
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server