2👍
If you wish to transition from HelloWorld
to MyPage
component then use created
or mounted
hook of the HelloWorld component like this:
created() {
setTimeout(() => {
// You can also use replace() instead of push()
this.$router.push('/myPage');
}, 2000);
}
Read more about hooks here.
1👍
You will have to do that in your HelloWorld.vue file. You will have something like this in the mount function of your HelloWorld.vue file
mounted() {
setTimeout(() => {
this.$router.push('/next-route')
}, 2000)
}
Hope that helps
- [Vuejs]-Vue: TypeError: Cannot read property 'dispatch' of undefined when submitting login form
- [Vuejs]-I'm not getting the errors back using axios
Source:stackexchange.com