vue router path code example
Example 1: vue router push
//Syntax - this.$router.push(path);
this.$router.push("/path");
Example 2: get params from route vuejs
const User = {
template: '<div>User {{ $route.params.id }}</div>'
}
Example 3: vue router url string
const resolved = this.$router.resolve({
name: 'SomeRouteName',
params: { id: item.id }
})
resolved.href // '/some-route-name/:id'