Can I call commit from one of mutations in Vuex store

后端 未结 12 1098
醉酒成梦
醉酒成梦 2021-02-03 16:25

I have a vuex store, like following:

import spreeApi from \'../../gateways/spree-api\'
// initial state
const state = {
  products: [],
  categories: []
}

// mu         


        
12条回答
  •  无人共我
    2021-02-03 17:11

    And if I have some common code that affects state between multiple mutations, I have to duplicate the same code on all my mutations? Or there's a better way to do that?

提交回复
热议问题