Vue · Attributes
vite-doctor/vueattrswarnNo fix
Why it happens
With inheritAttrs left on, fallthrough attrs land on the component root and on the element that binds $attrs, so classes and ids are duplicated and bubbling listeners such as @click run twice.
Fix
Add defineOptions({ inheritAttrs: false }) so attrs reach only the element that binds $attrs.
Example
Turn off attribute inheritance when forwarding $attrs
Before
<template>
<label class="field">
<input v-bind="$attrs">
</label>
</template>
After
<script setup lang="ts">
defineOptions({ inheritAttrs: false })
</script>
<template>
<label class="field">
<input v-bind="$attrs">
</label>
</template>
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm vite-doctor . --framework vue --rules vue/attrs/no-duplicate-attr-inheritance