0👍
Use router.push('url')
(remove the this.
). You haven’t declared router
in your data()
, so it wouldn’t be set on this
. It’s just a local variable.
- [Vuejs]-Precaching over 1000 assets damages performance
- [Vuejs]-Nuxt/Vue-Router Navigation Guards Reroute to Dynamic Route
0👍
in your code:
this.router
should be
this.$router
You need to define your router with path => component
const routes = [
{ path: '/foo', component: Foo },
{ path: '/bar', component: Bar }
]
If you would like to redirect user to another site, you may work with location object directly without router
// Sets the new location of the current window.
window.location = "https://www.example.com";
- [Vuejs]-Vue js get individual value of hidden input stored in div
- [Vuejs]-Why does Gridsome use Vue in the dist build?
Source:stackexchange.com