1👍
✅
The default setting for vue-router
is ‘hash’ mode. It adds an hash to your URL to prevent the browser from actually trying to load something from this URL when the user refreshes the window (as it treats everythign after the hash symbol as the hash).
You can change the mode to ‘history’ in the vue-router
config.
// router.js
export const router = new Router({
mode: 'history',
routes: [.....]
}
This will work out of the box and remove the hash in your URL – however, if the user reloads the page (refresh) the browser will try to look up the entire URL. Unless your server is configured to handle all ‘maverick’ routes, it will return a 404 Error. You can read more about this in the official vou-router config
Source:stackexchange.com