vuex store updated data, but did not trigger getters

Encountered a strange question, I will store, update array storage array, will take effect for the first time, the second time will not trigger getters, by examining the state found in the array is updated.

I tried many online solution:

1.getters return does not take effect

2.actions calls do not take effect

3.Vue.set (state, 'imgList', list) does not take effect

 

Later summary, vuex should not be amended and monitor changes in the array, so tried it first empty array, then the assignment:

state.imgList = null;
state.imgList = list;
You can successfully trigger getters, but watch the monitor can not change the data.

Guess you like

Origin www.cnblogs.com/wangqiao170/p/11797200.html