noVueVText (HTML)
Language HTML
Summary
Section titled “Summary”- Rule available since:
v2.6.0 - Diagnostic Category:
lint/nursery/noVueVText - This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
- Same as
vue/no-v-text
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noVueVText": "error" } } }}Description
Section titled “Description”Disallow the use of Vue’s v-text directive.
The v-text directive fills an element with text from a value, and replaces anything written between the element’s tags.
Because the text is set from an attribute, someone reading the template cannot see where it ends up.
Put the value between double curly braces ({{ }}) instead.
Vue calls this text interpolation. It shows the text exactly where it appears in the template,
and it can be mixed with other text in the same element.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<div v-text="message"></div>code-block.vue:1:6 lint/nursery/noVueVText ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Unexpected use of the v-text directive.
> 1 │ <div v-text="message"></div>
│ ^^^^^^^^^^^^^^^^
2 │
ℹ v-text replaces everything inside the element, so the text it shows is not visible where it appears in the template.
ℹ Put the value between double curly braces inside the element instead, like {{ message }}.
ℹ 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.
<div>{{ message }}</div><p>Hello, {{ name }}!</p>References
Section titled “References”Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.