Vue接口请求数据赋值给this.data在其他位置获取不到
- axios请求到的数据赋给属性不是响应式的,无法更新。解决方法使用实例方法:vm.$set( target, propertyName/index, value ),向响应式对象中添加一个 property,并确保这个新 property 同样是响应式的,且触发视图更新。它必须用于向响应式对象上添加新 property,因为 Vue 无法探测普通的新增 property (比如 this.myObject.newProperty = ‘hi’) 注意对象不能是 Vue 实例,或者 Vue 实例的根数据对象。
- https://segmentfault.com/q/1010000010731769