I was trying to remove the hashbang and I did it by adding mode:'history'
in the index file of vue-router:
export default new Router({
mode: 'history',
routes: [
{
path: '/',
name: 'Daksh',
component: Daksh
},
{
path: '/about',
name: 'About',
component: About
},
{
path: '/work',
name: 'Work',
component: Work
}
]
})
Then It was working well when I tried it in the hot reload mode but after running npm run build
, It stopped working for some weird reason.
Please Help :)
As the answer has been solved within the comments and as VonC suggested to add an answer so that it could be helpful for others , here it is:
Sinceyou are using nginx to run the files
Setup the server configuration for nginx as shown in example in the docs