Closed
Description
When using the data property on a component (i.e. anywhere except on new Vue), the value must be a function that returns an object.
based on style guide
Invalid:
Vue.component('some-comp', {
data: {
foo: 'bar'
}
})
export default {
data: {
foo: 'bar'
}
}
Valid:
new Vue({
data: function () {
return {
foo: 'bar'
}
}
})
new Vue({
data: {
foo: 'bar'
}
})
Vue.component('some-comp', {
data: function () {
return {
foo: 'bar'
}
}
})
export default {
data: function () {
return {
foo: 'bar'
}
}
}