📜  组件中的 vue js 数据属性必须是函数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:29.188000             🧑  作者: Mango

代码示例1
So, the reason why Vue forces the data property to be a function is that each instance of a component should have its own data object. If we don't do that, all instances will be sharing the same object and every time we change something, it will be reflected in all instances.