Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改文件后,热加载更新完再点击路由跳转,进入的页面全是空白 #108

Closed
fire17643 opened this issue Dec 20, 2022 · 12 comments
Labels
bug Something isn't working

Comments

@fire17643
Copy link

大佬好,遇到个问题,就当前工程构建运行,跑起来后,
1.在超级表格菜单ProTable,如修改表格两个width,
2.返回浏览器等热加载完成后
3.点击其他菜单,会一片空白,然后所有路由切换都空白了
必须手动刷新浏览器,这感觉损失了热加载功能了。
image
image
百度了发现是router-view相关,有个解决方法http://www.wangbaochao.com/blog/article/174,但是试了又会损失keepAlive功能,现在不知道咋弄了
最后感谢大佬开发这么优秀的后台管理框架,学习了很多,特别是ProTable用的真是方便,大赞!!!

@iwindy
Copy link

iwindy commented Dec 20, 2022

我也遇到有同样的问题

@HalseySpicy
Copy link
Owner

目前是 keep-alive 和 transtion 组件导致的这个问题,暂时没找到解决方案,可以在开发环境中先将其注释掉,避免影响开发。
image

@HalseySpicy HalseySpicy added the bug Something isn't working label Dec 21, 2022
@fire17643
Copy link
Author

去掉mode问题也会消失,但动画不好,就看怎么取舍了。
我看其他人的项目也有类似的问题,搞不好是vue3或者vue-router的bug

@HalseySpicy
Copy link
Owner

vuejs/core#5970

@HalseySpicy
Copy link
Owner

HalseySpicy commented Jan 9, 2023

目前升级到 vue 3.2.45,把 transition 标签的 mode="out-in" 属性删除掉开发就没问题了,上生产环境把 mode="out-in" 添加回来
image

@HalseySpicy
Copy link
Owner

vuejs/core#7121

@jianhao2010303
Copy link

+1

@wasonCheung
Copy link

如果组件中的元素没有用一个根元素来包裹。可以先尝试用一个根元素包裹所有元素。然后刷新页面。看看问题是否解决。

@szjhtz
Copy link

szjhtz commented Jun 10, 2023

我测试了,就是view里面很多页面不是单根导致的...其中的单根包括注释也会算一个根,检查下所有的会出现在transition里面的所有组件,保证一定的单根,重点重点...传统单根外面写的注释也会当做一个根,也就变成不是单根了...一旦被访问,页面就会出现空白....

@jianhao2010303
Copy link

+1,不知道这个问题什么时候可以修复。

@HalseySpicy
Copy link
Owner

vite5.0.4 已修复

@Qtt9952
Copy link

Qtt9952 commented Aug 2, 2024

vite5.0.4 已修复、

@HalseySpicy 你好~
请问为啥拉取最新的模板 "vite": "^5.3.2" 了,多根情况下,还是会有这个问题?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants