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

修改任意界面,切换其他界面就会出现空白,必须要手动重新刷新才可以出现界面 #114

Closed
AuroraWei opened this issue Aug 23, 2023 · 25 comments
Labels
bug Something isn't working special cases Problems you may encounter

Comments

@AuroraWei
Copy link

AuroraWei commented Aug 23, 2023

修改任意界面,切换其他界面就会出现空白,必须要手动重新刷新才可以出现界面

bdf0b

@pany-ang
Copy link
Member

pany-ang commented Aug 23, 2023

我写的中文文档,或者该 issue #101 都提到了解决方案

@AuroraWei
Copy link
Author

应该不是这个问题,控制台没有报错. 而且我是直接拉代码下来,几乎还没做什么修改,只是在首页打印一个console.log,当时可以显示,切换一下菜单就所有的页面都没有了。(我还检查了一下页面,所有的是跟vue2的写法一样)

@pany-ang
Copy link
Member

那你可以用我的预览地址或者拉一份新的代码测试,如果不能复现你说的情况,那就还是你改动后的代码有问题,并且这种情况目前为止都是因为没有保证一个根元素导致的

@AuroraWei
Copy link
Author

还是不行,我只是在首页添加了一个这个,我也很奇怪其他人没有遇见这个问题吗
6e31267e

@AuroraWei
Copy link
Author

5-05-55
就是这样,它也不报错

@pany-ang
Copy link
Member

你确定你没有改动任何代码?

@AuroraWei
Copy link
Author

我就加了给你截图的那个·

@pany-ang
Copy link
Member

你建一个仓库,把你代码推上去看看

@pany-ang
Copy link
Member

再说明一下你的环境,node 版本、浏览器版本等

@AuroraWei
Copy link
Author

node是18.16,浏览器Chrome116

@pany-ang
Copy link
Member

pany-ang commented Aug 23, 2023

node是18.16,浏览器Chrome116

这个不会有问题,只能上传代码给我复现了

@AuroraWei
Copy link
Author

这个代码真的就是你的代码

@pany-ang
Copy link
Member

我这边复现不了,就不能帮你解决问题... 预览环境你自己能复现吗?https://un-pany.github.io/v3-admin-vite/#/dashboard

@AuroraWei
Copy link
Author

AuroraWei commented Aug 23, 2023

https://gitee.com/mouyalin/v3-admin-vite.git 我把代码传到这里了,你拉下来试一下吧

@pany-ang
Copy link
Member

https://gitee.com/mouyalin/v3-admin-vite.git 我把代码传到这里了,你拉下来试一下吧

不能复现... 这份代码没问题

@w871507855
Copy link

w871507855 commented Aug 23, 2023

@AuroraWei 在src/App.vue里面修改下代码试试,在route-view中加 :key="$route.path"
image

@pany-ang
Copy link
Member

https://gitee.com/mouyalin/v3-admin-vite.git 我把代码传到这里了,你拉下来试一下吧

已复现,需要修改一下 TS 代码热更新后才能触发你说的问题

@AuroraWei
Copy link
Author

什么意思

@pany-ang
Copy link
Member

复现步骤:

  1. 进入一个页面
  2. 去修改该页面的 TS 代码
  3. 回到浏览器切换页面
  4. 内容区空白了

@AuroraWei
Copy link
Author

可以修复吗

@AuroraWei
Copy link
Author

因该是热更新的问题吧

@AuroraWei
Copy link
Author

按照上面那个朋友说的 ,在route-view中加 :key="$route.path",好像是可以

@AuroraWei
Copy link
Author

AuroraWei commented Aug 23, 2023

9c9
这样也可以,不要它的动画

HavocZhang added a commit to HavocZhang/v3-admin-vite that referenced this issue Aug 23, 2023
HavocZhang added a commit to HavocZhang/v3-admin-vite that referenced this issue Aug 23, 2023
@pany-ang
Copy link
Member

有可能是 vue 本身的问题:vuejs/core#7121

HavocZhang pushed a commit to HavocZhang/v3-admin-vite that referenced this issue Aug 24, 2023
@pany-ang
Copy link
Member

已修复该问题,代码已更新:db3de00

@pany-ang pany-ang added bug Something isn't working special cases Problems you may encounter labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working special cases Problems you may encounter
Projects
None yet
Development

No branches or pull requests

3 participants