The reserved names of Vue should not be used as prop names

  • VUE_RESERVED_NAME_IN_PROPS
  • Error
  • Medium
  • vue

This rule applies when the reserved names of Vue are used as prop names.

The following names are reserved in Vue:

  1. key
  2. ref
  3. Names starting with $

If props are defined with these names, Vue ignores them and outputs a warning message.

Note: This rule is based on Vue 3.x API specifications.

Noncompliant Code Example

View with compliant examples side by side
<script>
export default {
  props: {
    key: { // VUE_RESERVED_NAME_IN_PROPS alarm because 'key' is a reserved name in Vue.
      type: String
    }
  }
}
</script>

Compliant Code Example

View with noncompliant examples side by side
<script>
export default {
  props: {
    keyProp: {
      type: String
    }
  }
}
</script>

Version

This rule was introduced in DeepScan 1.72.0.

See

Was this documentation helpful?