vue router # in url code example
Example 1: get params from route vuejs
const User = {
template: '<div>User {{ $route.params.id }}</div>'
}
Example 2: vue router url string
const resolved = this.$router.resolve({
name: 'SomeRouteName',
params: { id: item.id }
})
resolved.href // '/some-route-name/:id'
Example 3: vue # in url
// To remove the # from url
// go in to router, index.js and change -->
const router = new VueRouter({
routes
})
to const router = new VueRouter({
routes,
mode: 'history'
})