在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML5/ vuex中怎么讓兩個(gè)store文件互通

vuex中怎么讓兩個(gè)store文件互通

想著在A的store文件中調(diào)用B的store文件中的action,有哪位大神指點(diǎn)一下,看vuex官房文檔中的module模塊中有稍微講解,但是還是不太懂

回答
編輯回答
臭榴蓮

鏈接

注冊全局action

      actions: {
        someAction: {
          root: true,
          handler (namespacedContext, payload) { ... } // -> 'someAction'
        }

使用全局action

// dispatch and commit are also localized for this module
// they will accept root option for the root dispatch/commit
dispatch('someOtherAction') // -> 'foo/someOtherAction'
dispatch('someOtherAction', null, { root: true }) // -> 'someOtherAction'
2018年6月10日 06:47