10 :問題描述
在使用vuex 時,有時候 我們在mutation中定義好方法,在頁面或組件提交時
有可能經常會遇到這個錯誤:---->>Do not mutate vuex store state outside mutation handlers.
9. 原因:
The reason is that arrays are stored as references in Javascript and payload.items is likely to be changed outside Vuex. So we should just use a fresh copy of payload.itemsinstead.
8:解決方法 如下圖

7:不建議使用Json.parse ,因為慢
