我尝试使用类似示例的代码 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);
}
}