Closed kinbod closed 3 months ago
这是由于 vue 的限制,写在 dom 中的模板必须是标准的 html 语法,所以只能放在 template 选项里。
这是由于 vue 的限制,写在 dom 中的模板必须是标准的 html 语法,所以只能放在 template 选项里。
那var-button和其他标签为什么可以识别呢?
那里面的var-button为什么可以正常识别
从 Windows 版邮件https://go.microsoft.com/fwlink/?LinkId=550986发送
发件人: haoziqaq @.> 发送时间: Sunday, April 7, 2024 2:54:07 PM 收件人: varletjs/varlet @.> 抄送: Bodkin Quan @.>; Author @.> 主题: Re: [varletjs/varlet] table not work (Issue #1576)
image.png (view on web)https://github.com/varletjs/varlet/assets/24223652/3636e670-7f87-4edc-90eb-8d53453aeb8f
这是由于 vue 的限制,写在 dom 中的模板必须是标准的 html 语法,所以只能放在 template 选项里。
― Reply to this email directly, view it on GitHubhttps://github.com/varletjs/varlet/issues/1576#issuecomment-2041340788, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB7CR5KV2NMROHFSSX3BYNLY4DUQ7AVCNFSM6AAAAABF3BVFKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRGM2DANZYHA. You are receiving this because you authored the thread.Message ID: @.***>
因为在 html 中,tbody 和 thead 必须在 table 元素中,所以这样的模板不属于标准的 html 模板。包括自闭合标签,一样也是无效的。var-button 因为符合标准 html 标签的规则,它会被认为是自定义元素存在。
建议就是所有的 vue 模板都写在 template 选项里,这样可以保证 vue 的所有模板编译器特性都能被使用。字符串高亮可以参考官方的推荐,使用 es6-string-html 插件。
好的,感谢,这下明白了
从 Windows 版邮件https://go.microsoft.com/fwlink/?LinkId=550986发送
发件人: haoziqaq @.> 发送时间: Sunday, April 7, 2024 3:06:08 PM 收件人: varletjs/varlet @.> 抄送: Bodkin Quan @.>; Author @.> 主题: Re: [varletjs/varlet] table not work (Issue #1576)
因为在 html 中,tbody 和 thead 必须在 table 元素中,所以这样的模板不属于标准的 html 模板。包括自闭合标签,一样也是无效的。var-button 因为符合标准 html 标签的规则,它会被认为是自定义元素存在。
― Reply to this email directly, view it on GitHubhttps://github.com/varletjs/varlet/issues/1576#issuecomment-2041343799, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB7CR5LXJSNGJ6ATUJUJRBDY4DV6BAVCNFSM6AAAAABF3BVFKWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRGM2DGNZZHE. You are receiving this because you authored the thread.Message ID: @.***>
不客气
Bug report 🐞
Version & Environment
Expectation
Actual results (or Errors)
Reproduction link