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

[Bug Report] CardGrid 卡片容器刷新后失效 #147

Closed
bigtomcat6 opened this issue Aug 21, 2024 · 2 comments
Closed

[Bug Report] CardGrid 卡片容器刷新后失效 #147

bigtomcat6 opened this issue Aug 21, 2024 · 2 comments

Comments

@bigtomcat6
Copy link

截屏2024-08-22 03 06 27

点击浏览器的刷新后容器失效(如下图),如果直接通过本页链接访问这个页面这个容器也会失效的。

截屏2024-08-22 03 06 39
@bigtomcat6
Copy link
Author

在pnpm build后在.vuepress/dist中可复现相同问题,但是这个问题在pnpm dev时无法复现。怀疑是build的时候的bug

@bigtomcat6 bigtomcat6 changed the title CardGrid 卡片容器刷新后失效 [Bug Report] CardGrid 卡片容器刷新后失效 Aug 22, 2024
@pengzhanbo
Copy link
Owner

这个问题稍显得有些怪异。初步判断是在 SSR 后,在浏览器端 进行 水合 时,出现了问题。
在水合完成后,计算属性的值没有被响应式的更新到 DOM 中。
我在这一步检测到的 计算属性是发生了更新的,计算结果正确,但 DOM 没有正确显示,而实际上调整窗口大小,其响应性并没有丢失,DOM 依然有触发计算属性后的更新。

我换了另外的方式来实现组件的逻辑,在 onMounted 中手动进行一次计算,组件恢复了正常的表现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants