[Vuejs]-How to pass parameter for dynamic route?

0👍

Try to remove the backticks:

switchPage() {
  let path = { name: 'worklistDynamic', params: { id: this.sideSwiperItems[this.indx + 1].id } }

  // or you can write the full path with backticks and interpolation
  let path = `/worklistDynamic/${this.sideSwiperItems[this.indx + 1].id}`

  this.$router.push(path)
}

Leave a comment