Skip to content

noVueDeprecatedInlineTemplate (HTML)

Language HTML
biome.json
{
"linter": {
"rules": {
"nursery": {
"noVueDeprecatedInlineTemplate": "error"
}
}
}
}

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.

<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>