Answers for "vue router redirect"

2

button click redirection to another page vue

<button @click="goToHome()"> </button>

//inside the script section, define the function:
 methods:{
   goToHome(){
   this.$router.push('/home'); 
      }
  }

//if the route accepts params, you can also use
this.$router.push({name:'home', params: {id: '[paramdata]'}});
Posted by: Guest on October-31-2020
5

vue redirect to route

// Use this in a lifecycle method
this.$router.push('/login');
Posted by: Guest on July-20-2020
10

vue router push

//Syntax - this.$router.push(path);
this.$router.push("/path");
Posted by: Guest on May-11-2020
0

redirect in vue

this.$router.push({ name: 'routename' })
Posted by: Guest on July-26-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language