I just create a new project from vue-cli. And I get this error when try to add vuex-router-sync
index.js?7e73:4 Uncaught TypeError: store.registerModule is not a function
at exports.sync (eval at <anonymous> (app.js:2927), <anonymous>:4:9)
at eval (eval at <anonymous> (app.js:1512), <anonymous>:23:26)
at Object.<anonymous> (app.js:1512)
at __webpack_require__ (app.js:660)
at fn (app.js:86)
at Object.<anonymous> (app.js:2966)
at __webpack_require__ (app.js:660)
at app.js:709
at app.js:712
main.js
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import { sync } from 'vuex-router-sync'
sync(store, router, { moduleName: 'RouteModule' })
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
template: '<App/>',
components: { App }
})
store
import Vuex from 'vuex'
import Vue from 'vue'
import home from './home.js'
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
home
}
})
export default {
store
}
I just create a new project from vue-cli. And I get this error when try to add vuex-router-sync
main.js
store