[vue]为什么对html标签属性使用模板字符串时需要在外层加上双引号或单引号?

Views :
Update time : 2025-06-28 21:50:16

补充貘老的回答。

Vue 模板向下兼容 HTML,引文来自 Vue 官方文档:All Vue templates are syntactically valid HTML that can be parsed by spec-compliant browsers and HTML parser(毕竟早期也是能拿已有的 HTML 元素当作模板来使用) 我看貘老是直奔编译器章节里去了 13.2.5.38 Attribute value (unquoted) state,其实 13.1.2.3 Attributes 里面更多人话。

我用红色在图片里圈出来: 上图文字复读:must not contain any li…。

[vue]为什么对html标签属性使用模板字符串时需要在外层加上双引号或单引号?
Related News
Read More >>
Blog Post With Youtube Video 为什么中国很少有人使用linux?
2025-06-28 23:30:16
为什么中国很少有人使用linux?...
Blog Post With Youtube Video 程序员用 Mac mini m4有必要买24G+的吗(非主力机)?
2025-06-28 22:35:16
程序员用 Mac mini m4有必要买24G+的吗(非主力机)?...
Blog Post With Youtube Video 如何设计一条 prompt 让 LLM 陷入死循环?
2025-06-28 23:50:18
如何设计一条 prompt 让 LLM 陷入死循环?...
Blog Post With Youtube Video 亚洲体坛最漂亮的十位女运动员都有谁?
2025-06-28 22:15:15
亚洲体坛最漂亮的十位女运动员都有谁?...

Leave Your Message