Here" /> Here" /> Here"/>

How to get params values in next page

729 Views Asked by At

In quasar i am using a button

<q-btn unelevated rounded color="positive" label="Next" icon-right="send" class="full-width" @click="goToCustomer">

Here is my function in setup

  const goToCustomer = function (){
      router.push({
        name: 'ITEM', path: '/item', params: { mycustomer: mycustomer}
      })
    }

i am passing a array through params Array is like this

const Customerselected = function(id, name ){
  mycustomer.value.splice(0)
  mycustomer.value.push({ id, name })
}

How i get mycustomer array in item page?

I tried {{ this.$route.params.mycustomer }}

And the result is

[object Object]

How i get values in the array?

TIA

1

There are 1 best solutions below

5
Quốc Cường On

if you are using script setup

import { useRoute } from 'vue-router';

const route = useRoute();

=> route.params // Is this what you look for?