pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
vue/no-duplicate-attr-inheritance |
enforce `inheritAttrs` to be set to `false` when using `v-bind="$attrs"` |
v7.0.0 |
enforce
inheritAttrs
to be set tofalse
when usingv-bind="$attrs"
This rule aims to prevent duplicate attribute inheritance.
This rule to warn to apply inheritAttrs: false
when it detects v-bind="$attrs"
being used.
<template>
<MyInput v-bind="$attrs" />
</template>
<script>
export default {
/* ✓ GOOD */
inheritAttrs: false
}
<template>
<MyInput v-bind="$attrs" />
</template>
<script>
export default {
/* ✗ BAD */
// inheritAttrs: true (default)
}
Nothing.
This rule was introduced in eslint-plugin-vue v7.0.0