Skip to content

Latest commit

 

History

History
116 lines (92 loc) · 2.03 KB

valid-model-definition.md

File metadata and controls

116 lines (92 loc) · 2.03 KB
pageClass sidebarDepth title description
rule-details
0
vue/valid-model-definition
require valid keys in model option

vue/valid-model-definition

require valid keys in model option

  • This rule has not been released yet.
  • ⚙️ This rule is included in all of "plugin:vue/essential", "plugin:vue/strongly-recommended" and "plugin:vue/recommended".

📖 Rule Details

This rule is aimed at preventing invalid keys in model option.

<script>
/* ✓ GOOD */
export default {
  model: {
    prop: 'list',
  }
}
</script>
<script>
/* ✓ GOOD */
export default {
  model: {
    event: 'update'
  }
}
</script>
<script>
/* ✓ GOOD */
export default {
  model: {
    prop: 'list',
    event: 'update'
  }
}
</script>
<script>
/* ✗ BAD */
export default {
  model: {
    prop: 'list',
    events: 'update'
  }
}
</script>
<script>
/* ✗ BAD */
export default {
  model: {
    props: 'list',
    events: 'update'
  }
}
</script>
<script>
/* ✗ BAD */
export default {
  model: {
    name: 'checked',
    props: 'list',
    event: 'update'
  }
}
</script>

🔍 Implementation