摘要: ###为什么 Vue 中的 data 必须是个函数? 官方文档的解释如下: ###为什么会出现上述“影响到其它所有实例”的情况呢? 其实这个问题取决于 JS 原型链知识,而非 Vue 我们先来看不是函数的情况: function Component() { } Component.prototype 阅读全文
posted @ 2020-09-14 21:13 Leophen 阅读(3360) 评论(0) 推荐(0) 编辑