In Vue.js docs I've found two ways of defining data so far: data: {}
and data() { return; }
.
data: {
defaultLayout: 'default'
}
data() {
return {
defaultLayout: 'default'
}
}
So far, I don't have any clue about third ways: data: () => ({})
. How it makes differ from above two's.
data: () => ({
defaultLayout: 'default'
})