tony
tony

Reputation: 199

route that remains on the same page vuejs

this is the first time that this happens to me, when I click on the next button in the url bar the address changes but the page remains on the same as if I did not click on next. However, the new step is displayed below. I hope someone will have the solution. Thanks in advance.

<template>
    <div>
      <button @click="send" >next</button>
   </div>
</template>

<script>
  methods:{
    send(){
   this.$router.push('/page/commande/1')
}
</script>

//router
{
    path:'/page/commande/1',
    name:'ConfirmationSend',
    component:() => import('../views/send.vue'),
  },

Upvotes: 1

Views: 3585

Answers (2)

tony
tony

Reputation: 199

For the moment I was able to work around the problem by adding an tag in the template part and the method I put this. $ Router.push in order to be able to use my navigation guards. This is a temporary fix while you figure out what the real problem is. Thank you all for your help.

Upvotes: 0

Siva Chandran
Siva Chandran

Reputation: 99

Hey you should add the key as fullPath of route in the router-view. As it will not re render the page/component only if the url params change.

<router-view :key='$route.fullPath' />

Upvotes: 3

Related Questions