Skip to content

useVueValidVHtml

¥Summary

¥How to configure

biome.json
{
"linter": {
"rules": {
"nursery": {
"useVueValidVHtml": "error"
}
}
}
}

¥Description

强制使用有效的 v-html 指令。

¥Enforce valid v-html directives.

此规则会在以下情况下报告 v-html 指令:

¥This rule reports v-html directives in the following cases:

  • 该指令包含一个参数。例如<div v-html:aaa></div>

    ¥The directive has an argument. E.g. <div v-html:aaa></div>

  • 该指令有一个修饰符。例如<div v-html.bbb></div>

    ¥The directive has a modifier. E.g. <div v-html.bbb></div>

  • 该指令没有属性值。例如<div v-html></div>

    ¥The directive does not have an attribute value. E.g. <div v-html></div>

¥Examples

¥Invalid

<div v-html:aaa="foo"></div>
<div v-html.bbb="foo"></div>
<div v-html></div>

¥Valid

<div v-html="htmlContent"></div>

¥Related links