I obtained a user object like this, how can I use the data inside this component to store the value of this user object to avoid directly modifying vuex when v-modal the value
黄舟2017-05-19 10:10:08
// ...
data: {
// 组件初始化时从 vuex user 中获取值
privateUser: this.user
}
watch: {
// 当 vuex 的 user 值变更时同步 data 属性
user (newVal) {
this.privateUser = newVal
}
}