JS.VUE.NO.COMPUTED.PROPERTIES.IN.DATA
The computed property cannot be accessed in `data()` before initialization
Rule Details
This rule disallow accessing computed properties in data()
.
The computed property cannot be accessed in data()
because is before initialization.
{'vue/no-computed-properties-in-data': ['error']}
Copy
<script>
export default {
data() {
return {
/* BAD */
bar: this.foo
}
},
computed: {
foo () {}
}
}
</script>
Options
Nothing.