I\'m curious both of this data function, is there any difference between this two.
I usually saw is
data () {
return {
obj
}
}
It has something to do with ES5 or ES6 syntax, If you have used arrow functions ()=> in your previous scripts it is safe to use the following codes.
// tested and this.myData can be accessed in the component
data: () => { return {
myData: 'someData',
myStuff: this.stuffProp
} }
// this also works
data: () => ({
myData: 'someData',
myStuff: this.stuffProp
})