[Vuejs]-How to remove # from vuejs root router?

3👍

By default VueRouter uses hash mode.

You can change the mode to history if you want:

const router = new Router({
  mode: 'history',
})

Probably the main reason for doing this is that, if you use history mode you need to have a special setup for your web server to handle the urls properly. When using hash bangs it works out of the box.

Leave a comment