What is difference between 'data:' and 'data()' in Vue.js?
问题 I have used data option in two ways. In first snippet data object contains a key value, however, in second data is a function. Is there any benefits of individuals.Not able to find relevant explanations on Vue.js Docs Here are two code snippets: new Vue({ el: "#app", data: { message: 'hello mr. magoo' } }); new Vue({ el: "#app", data() { return { message: 'hello mr. magoo' } } }); Both are giving me the same output. 回答1: It seems as though the comments on your question missed a key point when