Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
Switch page when clicking on name in list table in vuejs?

I am making list page in vuejs. And now I'm having some problems as follows:

<template>
    <vue-good-table
            :columns="columns"
            :rows="row"
            :search-options="{
              enabled: true,
              externalQuery: searchTerm,
            }"
    </vue-good-table>
</template>
<script>
    data() {
      return: {
         row: [];
         columns: [
        {
          label: "Name",
          field: "name",
        },
        {
          label: "Price",
          field: "price",
        },
        {
          label: "Quantity",
          field: "quantity",
        },
      ],
      }
    },
    created() {
       axios
          .get("/project/api/list")
          .then((res) => {
              this.rows = res.data;
          })
    }
</script>

enter image description here

I want when I click on the name samsung or iphone it will go to that product detail page.

Route detail product :

export default [{
        path: '/detail/product/:id',
        name: 'detail-product',
        component: () =>
            import ('@/views/product/list.vue'),
        meta: {
            resource: 'PRODUCT',
        },
    }, ]

Any ideas please help me..Thanks.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try to add event @on-row-click to your table:

<vue-good-table
  :columns="columns"
  :rows="row"
  :search-options="{
    enabled: true,
    externalQuery: searchTerm,
  }"
  @on-row-click="onRowClick"
</vue-good-table>

then in method route to detail page:

methods: {
  onRowClick(params) {
    this.$router.push('/detail/product/' + params.row.id)
  }
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!