noVueDeprecatedInlineTemplate (HTML)
Language HTML
Summary
Section titled “Summary”- Rule available since:
v2.6.5 - Diagnostic Category:
lint/nursery/noVueDeprecatedInlineTemplate - This rule doesn’t have a fix.
- The default severity of this rule is error.
- This rule belongs to the following domains:
- Sources:
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noVueDeprecatedInlineTemplate": "error" } } }}Description
Section titled “Description”Disallow the inline-template attribute on Vue components.
In Vue 2, the inline-template attribute made a component use the content between
its tags as its own template. Vue 3 removed this feature. The content is now passed
to the component like any other content between its tags, and the component only
shows it if its template has a <slot>.
Move the content into the component’s own template instead. If the parent needs to decide what is shown, pass the content through a slot.
Only the attribute written exactly as inline-template is reported.
A bound value such as :inline-template="value" is an ordinary prop and is allowed.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<template> <my-component inline-template> <div>{{ message }}</div> </my-component></template>code-block.vue:2:17 lint/nursery/noVueDeprecatedInlineTemplate ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ The inline-template attribute is not supported in Vue 3.
1 │ <template>
> 2 │ <my-component inline-template>
│ ^^^^^^^^^^^^^^^
3 │ <div>{{ message }}</div>
4 │ </my-component>
ℹ Vue 3 no longer uses the content between the component's tags as its template. The component only shows that content if its template has a <slot>.
ℹ Move the content into the component's own template, or pass it to the component through a slot.
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
<template> <my-component> <div>{{ message }}</div> </my-component> <my-component :inline-template="value" /></template>References
Section titled “References”Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.