vue/no-restricted-v-bind
Disallow restricted v-bind arguments.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
warning |
None | No | None |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
Bad
:v-focus binds a directive-shaped argument as an attribute.
<template>
<input :v-focus="enabled" />
</template>
Good
v-focus uses the directive syntax directly.
<template>
<input v-focus="enabled" />
</template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"vue/no-restricted-v-bind": "warn"
}
},
});
Then run vp run lint.