Vue SSR和动态导入vuex模块

时间:2020-08-18 05:39:05

标签: vue.js vuex server-side-rendering vuex-modules

我尝试使用类似示例的代码 https://github.com/olegpisklov/vue-ssr-simple-setup 和其他3个但无法动态导入vuex的模块。

当我导入模块时,我看不到它的动作,获取器,处于开发模式的状态(在生产环境中我不尝试)。

const notificationsModule = () => import('../store/modules/Notifications.js');

  export default {
  ***
  mounted() {
    this.$store.registerModule("notifications", notificationsModule, { preserveState: true });
  },
  serverPrefetch () {
    this.$store.registerModule("notifications", notificationsModule);
  }  
}

0 个答案:

没有答案