使用VueX 存儲登錄狀態
問題一:在vue頁面中使用 this.$store.dispatch('login',option) 沒有任何報錯 沒有任何反應
問題二:在js中使用 this.$tore.state.userInfo 報錯 Uncaught TypeError: Cannot read property '$store' of undefined
解決方案:
import store from '../store'
const unserInfo = store.state.userInfo;