How can I solve “Uncaught TypeError: Cannot read property 'get' of undefined” in the vuex store?
问题 If I try this .$session.get(SessionKeys.Cart) in my component like this : <template> ... </template> <script> ... export default { ... methods: { add(item) { console.log(this.$session.get(SessionKeys.Cart) ... } } } </script> It works. I success get session cart But if I try it in the my vuex store like this : import { set } from 'vue' // initial state const state = { list: {} } // getters const getters = { list: state => state.list } // actions const actions = { addToCart ({ dispatch,commit