我遇到了问题
data() {
return {
list: [],
initState: { id: null, data: null }
}
},
computed: {
...mapState({
contacts: (state) => state.ContactBook.Contacts
})
},},
methods: {
setinitState(payload) {
this.initState.data = contacts[this.contactID]
},
如何使 this.initState 静态?我需要联系人[this.contactID] 更改时没有更改 this.initState ...
答案 0 :(得分:1)
答案 1 :(得分:0)
state.snapshot = JSON.parse(JSON.stringify(state.Contacts [payload]))