useVueComponentIs (HTML)
Language HTML
Summary
Section titled “Summary”- Rule available since:
v2.6.3 - Diagnostic Category:
lint/nursery/useVueComponentIs - This rule doesn’t have a fix.
- The default severity of this rule is error.
- This rule belongs to the following domains:
- Sources:
- Same as
vue/require-component-is
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "useVueComponentIs": "error" } } }}Description
Section titled “Description”Require <component> elements to bind the is attribute.
Vue’s built-in <component> element renders the component passed to its
is attribute, which lets you switch between components in one place.
The value must be bound with :is or v-bind:is. Without it, Vue has
no component to render.
A plain is="..." attribute is also reported, because it always renders
the same component. Use that component directly instead.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<template> <component /></template>code-block.vue:2:3 lint/nursery/useVueComponentIs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This <component> element doesn't bind the is attribute.
1 │ <template>
> 2 │ <component />
│ ^^^^^^^^^^^^^
3 │ </template>
4 │
ℹ Vue renders the component passed to :is. Without it, there is no component to render.
ℹ Bind the component with :is, or use the component directly if it never changes.
ℹ 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> <component is="MyComponent" /></template>code-block.vue:2:3 lint/nursery/useVueComponentIs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ This <component> element doesn't bind the is attribute.
1 │ <template>
> 2 │ <component is="MyComponent" />
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 │ </template>
4 │
ℹ Vue renders the component passed to :is. Without it, there is no component to render.
ℹ Bind the component with :is, or use the component directly if it never changes.
ℹ 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> <component :is="currentView" /> <component v-bind:is="currentView" /></template>Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.