While exploring the Vue.js documentation, I came across two ways to define data: data: {}
and data() { return; }
.
data: {
defaultLayout: 'default'
}
data() {
return {
defaultLayout: 'default'
}
}
However, there is a third way that I am not familiar with yet: data: () => ({})
. I wonder how it differs from the first two methods.
data: () => ({
defaultLayout: 'default'
})