[Vuejs]-How to pass props from URL in VueJS when redirect in vue-router?

0👍

this.$router.push({ path: '/${this.$store.state.locale}/my-cart', params: {step: '2' }})

please change the name and replace path into code

0👍

If you want to use url to declare for a path. You need to change "name" to "path".

this.$router.push({ path: '/${this.$store.state.locale}/my-cart', params: {step: '2'} })

Else you want to use name, you can pass value of name attribute that define in route.js file instead pass url.

this.$router.push({ name: 'namePath', params: {step: '2'} })

Leave a comment