4 ms·
Vue files are absolutely not valid HTML.
by robertoandred 3y ago
Vue files are absolutely not valid HTML.
- uallo 3y ago> A Vue SFC is syntactically compatible with HTML. https://vuejs.org/api/sfc-spec.html https://vuejs.org/api/sfc-spec.html
- robertoandred 3y agoNo, Vue’s template attributes are not valid html
- uallo 3y agoVue uses @:[]. in their attributes and these are valid HTML attribute syntax. HTML attribute syntax only disallows SPACE"'>/= and some specific code points. Everything else is valid syntax. https://vuejs.org/guide/essentials/template-syntax.html https://vuejs.org/guide/essentials/template-syntax.html https://html.spec.whatwg.org/#attributes-2 https://html.spec.whatwg.org/#attributes-2
- moritzwarhier 3y agoThis is not the point, the point is if they are valid JavaScript or TypeScript.
- CharlieDigital 3y agoTemplate, script, and style are all valid tags.
- codethief 3y agoSure but that is as helpful as saying a Word document (.docx) is a valid ZIP file. The tags in Vue files are merely containers of the actually interesting stuff.
- runarberg 3y agoWhat matters for most (all?) tools is that the file is a valid HTML syntax. Most (all?) tools don’t care if the document it self is valid HTML. I don’t think I’ve used a single developer tool which stops working if I remove the <title> tag, nest <a> elements or even insert a self closing <div /> tag.
- deleted 3y ago[deleted]
- codethief 3y agoI think we're completely talking past each other. I was talking about type checking of TS, template and SCSS code inside a .vue file.