How to get vuex state from a javascript file (instead of a vue component)

后端 未结 4 1296
孤街浪徒
孤街浪徒 2021-02-02 09:06

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 t

4条回答
  •  悲&欢浪女
    2021-02-02 09:46

    import store from './store'
    

    and than

    store.commit('mutation_name', mutation_argument)
    

    if you use js file

提交回复
热议问题