Vue · VUE0014
Prefer defineModel for component v-model
Finds Vue style code that should use the supported define model pattern instead.
Run this rule
pnpm vite-doctor . --framework vue --rules vue/style/prefer-define-model
Why it matters
defineModel() keeps a component's model prop, update event, modifiers, and type in one compiler-checked declaration.
Recommended fix
Use the Vue-supported define model pattern instead.
Useful links
Example
Use defineModel
Before
<script setup lang="ts">
defineProps<{ modelValue: string }>()
const emit = defineEmits<{ 'update:modelValue': [value: string] }>()
</script>
After
<script setup lang="ts">
const modelValue = defineModel<string>()
</script>