Vetur: [vue-language-server] Self-closing should not be used.

Created on 23 Jun 2017  路  5Comments  路  Source: vuejs/vetur

qq20170623-191557 2x

why can not use?

question

Most helpful comment

I am not sure whether it is a good choice to forbid self-closing tags by default. W3C html5 standard allows self-closing tags when they are void-elements or foreign elements:

https://www.w3.org/TR/html5/syntax.html#start-tags

image

Customized vue components, although not covered by html5 standard, might have no reason to disallow self-closing, I think.

In fact both nuxt and quasar recommend self-closing components when there are no slots in them.

All 5 comments

I am not sure whether it is a good choice to forbid self-closing tags by default. W3C html5 standard allows self-closing tags when they are void-elements or foreign elements:

https://www.w3.org/TR/html5/syntax.html#start-tags

image

Customized vue components, although not covered by html5 standard, might have no reason to disallow self-closing, I think.

In fact both nuxt and quasar recommend self-closing components when there are no slots in them.

Agreed with @beeplin -- another example is image and line break tags.

Was this page helpful?
0 / 5 - 0 ratings