Skip to content

Commit 9931307

Browse files
committed
docs: consist usage of in-DOM template
1 parent cabeca4 commit 9931307

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/style-guide/rules-strongly-recommended.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ components/
337337

338338
## Self-closing components {#self-closing-components}
339339

340-
**Components with no content should be self-closing in [Single-File Components](/guide/scaling-up/sfc), string templates, and [JSX](/guide/extras/render-function#jsx-tsx) - but never in DOM templates.**
340+
**Components with no content should be self-closing in [Single-File Components](/guide/scaling-up/sfc), string templates, and [JSX](/guide/extras/render-function#jsx-tsx) - but never in in-DOM templates.**
341341

342342
Components that self-close communicate that they not only have no content, but are **meant** to have no content. It's the difference between a blank page in a book and one labeled "This page intentionally left blank." Your code is also cleaner without the unnecessary closing tag.
343343

@@ -375,15 +375,15 @@ Unfortunately, HTML doesn't allow custom elements to be self-closing - only [off
375375

376376
## Component name casing in templates {#component-name-casing-in-templates}
377377

378-
**In most projects, component names should always be PascalCase in [Single-File Components](/guide/scaling-up/sfc) and string templates - but kebab-case in DOM templates.**
378+
**In most projects, component names should always be PascalCase in [Single-File Components](/guide/scaling-up/sfc) and string templates - but kebab-case in in-DOM templates.**
379379

380380
PascalCase has a few advantages over kebab-case:
381381

382382
- Editors can autocomplete component names in templates, because PascalCase is also used in JavaScript.
383383
- `<MyComponent>` is more visually distinct from a single-word HTML element than `<my-component>`, because there are two character differences (the two capitals), rather than just one (a hyphen).
384384
- If you use any non-Vue custom elements in your templates, such as a web component, PascalCase ensures that your Vue components remain distinctly visible.
385385

386-
Unfortunately, due to HTML's case insensitivity, DOM templates must still use kebab-case.
386+
Unfortunately, due to HTML's case insensitivity, in-DOM templates must still use kebab-case.
387387

388388
Also note that if you've already invested heavily in kebab-case, consistency with HTML conventions and being able to use the same casing across all your projects may be more important than the advantages listed above. In those cases, **using kebab-case everywhere is also acceptable.**
389389

@@ -401,7 +401,7 @@ Also note that if you've already invested heavily in kebab-case, consistency wit
401401
```
402402

403403
```vue-html
404-
<!-- In DOM templates -->
404+
<!-- In in-DOM templates -->
405405
<MyComponent></MyComponent>
406406
```
407407

@@ -416,7 +416,7 @@ Also note that if you've already invested heavily in kebab-case, consistency wit
416416
```
417417

418418
```vue-html
419-
<!-- In DOM templates -->
419+
<!-- In in-DOM templates -->
420420
<my-component></my-component>
421421
```
422422

0 commit comments

Comments
 (0)