1<button @click="goToHome()"> </button>
2
3//inside the script section, define the function:
4 methods:{
5 goToHome(){
6 this.$router.push('/home');
7 }
8 }
9
10//if the route accepts params, you can also use
11this.$router.push({name:'home', params: {id: '[paramdata]'}});