Skip to content

docs: consist usage of in-DOM template #2521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/guide/components/registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,6 @@ Throughout the guide, we are using PascalCase names when registering components.

2. `<PascalCase />` makes it more obvious that this is a Vue component instead of a native HTML element in templates. It also differentiates Vue components from custom elements (web components).

This is the recommended style when working with SFC or string templates. However, as discussed in [in-DOM Template Parsing Caveats](/guide/essentials/component-basics#in-dom-template-parsing-caveats), PascalCase tags are not usable in DOM templates.
This is the recommended style when working with SFC or string templates. However, as discussed in [in-DOM Template Parsing Caveats](/guide/essentials/component-basics#in-dom-template-parsing-caveats), PascalCase tags are not usable in in-DOM templates.

Luckily, Vue supports resolving kebab-case tags to components registered using PascalCase. This means a component registered as `MyComponent` can be referenced in the template via both `<MyComponent>` and `<my-component>`. This allows us to use the same JavaScript component registration code regardless of template source.
4 changes: 2 additions & 2 deletions src/style-guide/rules-strongly-recommended.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Unfortunately, HTML doesn't allow custom elements to be self-closing - only [off
```

```vue-html
<!-- In DOM templates -->
<!-- In in-DOM templates -->
<my-component/>
```

Expand All @@ -367,7 +367,7 @@ Unfortunately, HTML doesn't allow custom elements to be self-closing - only [off
```

```vue-html
<!-- In DOM templates -->
<!-- In in-DOM templates -->
<my-component></my-component>
```

Expand Down