為什么在Info.Vue里面使用store.state.count視圖不會(huì)自動(dòng)更新呢
<template> ??<div> ????hello?info ????<div>{{count}}</div> ????<button?type="button"?@click="add()">添加</button> ??</div> </template> <script> import?store?from?'@/store'; export?default?{ ??name:?'Info', ??store, ??data()?{ ????return?{ ??????count:?store.state.count, ????}; ??}, ??methods:?{ ????add()?{ ??????console.log('add?Event'); ??????store.commit('increase'); ????}, ??}, }; </script>
2019-09-16
computed