Pattern: Use of this
within the props default value factory function
Issue: -
This rule reports the use of this
within the props default value factory functions. In Vue.js 3.0.0+, props default value factory functions no longer have access to this
.
<script>
export default {
props: {
a: String,
b: {
default () {
/* ✗ BAD */
return this.a
}
}
}
}
</script>
<script>
export default {
props: {
a: String,
b: {
default (props) {
/* ✓ GOOD */
return props.a
}
}
}
}
</script>