我使用来自here和here的hackernews方法设置vuex和SSR,并且它都能正常工作。 app.js: // Expose a factory function that creates a fresh set of store, router,
// app instances on each call (which is called for each SSR request)
import Vue from 'vue'
import Vuex from 'vuex'
import Users from './modules/Users'
Vue.use(Vuex)
export const store = new Vuex.Store({
namespaced: true,
state: {
foo: false,
据我所知,在Vuex我们可以做store.subscribe,我们通过一个被称为在商店的每一个变化回调。 在我的应用程序中,我有一个有很多模块的商店,并且想要subscribe只适用于特定的模块,而不必拥有这种逻辑if (mutation.type != thisModule.type) return;。 是否可以只订阅一些模块? Could not find it in the docs。