Weird "#/" at the end of URL locally

Viewed 25

I am messing around locally with a laravel and vue project, I also have vue-router setup but my URL look like this: <virtual-host>.loc/#/.

Whenever I access my v-host it loads but I get this weird #/ thing appended to the end of the URL. Does anybody know where it comes from? Is it a JS thing?

1 Answers

by default vue js use hash mode. that's why you see that type of url. to change this behavior you need to set mode property to history like this,

const router = new VueRouter({
  mode: 'history',
  routes: [...]
})
Related