简体   繁体   English

Html 页面在 barba js 转换后未加载

[英]Html page not loading after barba js transition

I have this issue where when i click a link to go to another page, the barba transitions runs flawlessly, but it stays in the same html page and i have to refresh the page in order for the other page to load我有这个问题,当我单击指向 go 的链接到另一个页面时,barba 转换运行完美,但它保持在同一个 html 页面中,我必须刷新页面才能加载其他页面

I tried setting a window.open after the transition run to temporarely fix it, but i have no idea what might be going on我尝试在过渡运行后设置一个 window.open 以暂时修复它,但我不知道会发生什么

Here is the code: https://github.com/david1opez/Mentes-Brillantes/issues/5这是代码: https://github.com/david1opez/Mentes-Brillantes/issues/5

After hours of breaking my head i found out that the error was in the html page经过几个小时的努力,我发现错误出现在 html 页面中

 barba.init({ sync: true, transitions: [{ async leave(data) { const done = this.async(); pageTransition(); await delay(1500); }, async enter(data) {} }] });

I forgot to put done();我忘了把done(); after await delay(1500) await delay(1500)

So now this is the working code所以现在这是工作代码

 barba.init({ sync: true, transitions: [{ async leave(data) { const done = this.async(); pageTransition(); await delay(1500); done(); }, async enter(data) {} }] });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM