Skip to content
Advertisement

Tag: vuejs2

Why watcher is better than computed to perform asynchronous or expensive operations in response to changing data in vue.js?

Documentation of Vue.js says: Using the watch option allows us to perform an asynchronous operation (accessing an API), limit how often we perform that operation, and set intermediary states until we get a final answer. None of that would be possible with a computed property. While on the same page, we can see that computed property uses a function the

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 next handler Answer this.$router.push({ path:this.$route.path, query: { step: this.current } })

Advertisement