You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules/no-v-text-v-html-on-component.md
+23-4Lines changed: 23 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -25,11 +25,15 @@ If you use v-text / v-html on a component, it will overwrite the component's con
25
25
<!-- ✓ GOOD -->
26
26
<div v-text="content"></div>
27
27
<div v-html="html"></div>
28
+
<svg><g v-text="content" /></svg>
29
+
<math><mi v-text="content" /></math>
28
30
<MyComponent>{{ content }}</MyComponent>
29
31
30
32
<!-- ✗ BAD -->
31
33
<MyComponent v-text="content"></MyComponent>
32
34
<MyComponent v-html="html"></MyComponent>
35
+
<g v-text="content" />
36
+
<mi v-text="content" />
33
37
</template>
34
38
```
35
39
@@ -39,14 +43,15 @@ If you use v-text / v-html on a component, it will overwrite the component's con
39
43
40
44
```json
41
45
{
42
-
"vue/no-v-text-v-html-on-component": [
43
-
"error",
44
-
{ "allow": ["router-link", "nuxt-link"] }
45
-
]
46
+
"vue/no-v-text-v-html-on-component": ["error", {
47
+
"allow": ["router-link", "nuxt-link"],
48
+
"ignoreElementNamespaces": false
49
+
}]
46
50
}
47
51
```
48
52
49
53
-`allow` (`string[]`) ... Specify a list of custom components for which the rule should not apply.
54
+
-`ignoreElementNamespaces` (`boolean`) ... Specify whether to ignore the namespace restrictions for SVG and MathML elements, so that the rule should not apply. Default is `false`.
50
55
51
56
### `{ "allow": ["router-link", "nuxt-link"] }`
52
57
@@ -65,6 +70,20 @@ If you use v-text / v-html on a component, it will overwrite the component's con
0 commit comments