如何保留全局组件内部的children
?
#2069
Unanswered
zhangfisher
asked this question in
Q&A
Replies: 1 comment
-
只要 children 是标准 HTML 节点(包括纯文本)都会保留; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
我开发的
LiteTree
预期目标是提供一个更加方便的在dumi
中渲染树的组件,包括:@lite-tree/react
用在dumi
@lite-tree/vue
用在vitepress
使用方法如下:
渲染效果如下:
现在碰到一个问题,在
markdown
中使用时渲染引擎会将<LiteTree>树数据</LiteTree>
里面的树数据忽略,导致组件无法读取到树数据。这个问题在
vitepress
里面可以通过配置vite.config.ts
的模板编译参数whitespace: 'preserve'
来解决。但在
React/Jsx
组件中使用多行模板字符这样也可以接受,像这样但是在
dumi
下,这样就导致
LiteTree
无法开心地正常使用了,是否有办法解决?Beta Was this translation helpful? Give feedback.
All reactions