【发布时间】:2020-10-27 11:04:43
【问题描述】:
我在 Vue 3 中,我开始向 vue 添加一个新的 Vuex.Store,但我不断收到这个 javascript 错误。自从我使用 Vue 3 以来,我也用 createStore 尝试过同样的事情,但它仍然是一样的。
我错过了什么?
const store = new Vuex.Store({
modules: {
account: {
namespaced: true,
state: () => ({ }),
getters: {
isAdmin () { }
},
actions: {
login () { }
},
mutations: {
login () { }
}
}}
});
比我添加到 Vue 作为存储:
new Vue({
router,
store,
render: h => h(App),
}).$mount('#app');
我错过了什么?
完全错误
vuex.esm-browser.js?5502:644 Uncaught TypeError: Object(...) is not a function
at resetStoreState (vuex.esm-browser.js?5502:644)
at new Store (vuex.esm-browser.js?5502:387)
at createStore (vuex.esm-browser.js?5502:337)
at eval (main.js?56d7:37)
at Module../src/main.js (app.js:1105)
at __webpack_require__ (app.js:849)
at fn (app.js:151)
at Object.1 (app.js:1118)
at __webpack_require__ (app.js:849)
at checkDeferredModules (app.js:46)
【问题讨论】:
-
你能用堆栈跟踪发布完整的错误吗?
-
我添加了完整的错误。
标签: javascript vue.js vuex