Skip to content

在什么场景下组件用 h 函数 或者 jsx #3931

Answered by XieZongChen
Miofly asked this question in Q&A
Discussion options

You must be logged in to vote

两者性能基本没有差距。jsx 更方便书写 template,且对于维护者来说几乎没有难度曲线。在部分场景(比如重逻辑且基本没有 template)下 jsx 可能没有 h 函数简洁,所以会用到 h 函数。而组件示例中使用 h 函数只是因为其不用做任何配置,以免误导不会配置 jsx 的用户。

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by XieZongChen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants