vue中使用vuex将数据保存在store中,computed 属性取数据,store.commit 方法提交数据,watch监听数据变化时执行方法。问题是没有提交数据的情况下,watch能监听到数据变化,原因是什么呢?
computed
有可能是:
<keep-alive>
undefined
你可以watch里面打印一下新值和旧值。
watch
2.1m questions
2.1m answers
60 comments
56.8k users