[Vuejs]-How to go the link when click button vue js

0👍

Building off of JeRmiZa answer, I’d like to add an alternative option that is more readable in the template and requires no programmic routing.

Use vue-router’s router-link component:
https://router.vuejs.org/guide/#router-link

<router-link v-for="s in student.student_records" :to="`/student/${s.uuid}/fee/${student_record.id}`">
  <button class="dropdown-item custom-dropdown"> 
    {{student_record.batch.course.name}} {{trans('finance.fee_allocation')}}
  </button>
</router-link>

Leave a comment