How to get vuex state from a javascript file (instead of a vue component)
问题 I am working with vuex (2.1.1) and get things working within vue single file components. However to avoid too much cruft in my vue single file component I moved some functions to a utils.js module which I import into the vue-file. In this utils.js I would like to read the vuex state. How can I do that? As it seems approaching the state with getters etc is presuming you are working from within a vue component, or not? I tried to import state from '../store/modules/myvuexmodule' and then refer