Skip to content

Latest commit

 

History

History
76 lines (55 loc) · 2.16 KB

no-deprecated-model-definition.md

File metadata and controls

76 lines (55 loc) · 2.16 KB
pageClass sidebarDepth title description
rule-details
0
vue/no-deprecated-model-definition
disallow deprecated `model` definition (in Vue.js 3.0.0+)

vue/no-deprecated-model-definition

disallow deprecated model definition (in Vue.js 3.0.0+)

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

📖 Rule Details

This rule reports use of the component model option, which has been deprecated in Vue.js 3.0.0+.

See Migration Guide – v-model for more details.

<script>
export default defineComponent({
  model: {
    prop: 'my-value',
    event: 'input'
  }
})
</script>

🔧 Options

{
  "vue/no-deprecated-model-definition": ["error", {
    "allowVue3Compat": true
  }]
}

"allowVue3Compat": true

Allow model definitions with prop/event names that match the Vue.js 3.0.0+ v-model syntax, i.e. modelValue/update:modelValue or model-value/update:model-value.

<script>
export default defineComponent({
  model: {
    prop: 'modelValue',
    event: 'update:modelValue'
  }
})
</script>

👫 Related Rules

📚 Further Reading

🔍 Implementation