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

每次改动一个页面或 details 容器内的内容,就会导致 details 关闭,这是否能避免? #4594

Open
keer-tea opened this issue Mar 3, 2025 · 2 comments

Comments

@keer-tea
Copy link
Contributor

keer-tea commented Mar 3, 2025

点击 details 容器后,可以看到 'content' 内容
Image

如果修改 'content' 为 'content ++',details 容器默认就收起来了。

Image

需要再次点击 details 容器,才能看到修改的内容。

Image

这是否是一个bug呢?或者说能否有办法避免这个问题?感谢你的回复。

@keer-tea
Copy link
Contributor Author

keer-tea commented Mar 3, 2025

https://vitepress.dev/guide/markdown#custom-containers 相关文档链接在这

@brc-dd
Copy link
Member

brc-dd commented Mar 3, 2025

It is actually an html element and doesn't have state that can be handled by hmr. One option is you can specify open while you're working:

::: details {open}
This is a details block.
:::

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