Answers for "vuejs manually redirect with page load"

13

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
0

vue route automatic redirect

const router = new VueRouter({
  routes: [
    { path: '/a', redirect: { name: 'foo' }}
  ]
})
Posted by: Guest on November-04-2021

Code answers related to "vuejs manually redirect with page load"

Code answers related to "Javascript"

Browse Popular Code Answers by Language