Skip to content

vue/prefer-v-model

enforce using v-model instead of :prop/@update:prop pair

  • This rule has not been released yet.
  • 💡 Some problems reported by this rule are manually fixable by editor suggestions.

📖 Rule Details

In Vue 3, :foo="bar" @update:foo="bar = $event" can be simplified to v-model:foo="bar", and :modelValue="foo" @update:modelValue="foo = $event" can be simplified to v-model="foo". This rule suggests those simplifications.

Now loading...

🔧 Options

Nothing.

📚 Further Reading

🔍 Implementation