Skip to content
Advertisement

Vue-router change query dynamically in navigation stepper

There is this project I’m working on and I’m stuck. I want when I click next step button the route becomes http://icontent.me/app/employer/make-order?step=1 and so on.

I’m using Vue.js and vue-router.

How do I make this happen? I have included the router.js and a screenshot if necessary.

router.js

JavaScript

next handler

JavaScript

Advertisement

Answer

this.$router.push({ path:this.$route.path, query: { step: this.current } })

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement