1👍
Changing the mode doesn’t do anything while the mode is only used in the constructor of VueRouter. With the mode VueRouter executes the following code (https://github.com/vuejs/vue-router/blob/dev/src/index.js):
switch (mode) {
case 'history':
this.history = new HTML5History(this, options.base)
break
case 'hash':
this.history = new HashHistory(this, options.base, this.fallback)
break
case 'abstract':
this.history = new AbstractHistory(this, options.base)
break
default:
if (process.env.NODE_ENV !== 'production') {
assert(false, `invalid mode: ${mode}`)
}
}
But basically it’s better to recreate your VueRouter
- [Vuejs]-Vue v-for index undefined in array object
- [Vuejs]-Errors and warnings when serving/building with a private npm package in Vue CLI
-1👍
So, why don’t you initiate it using mode: "hash"
?
Source:stackexchange.com