rows: A" /> rows: A" /> rows: A"/>

how to return an array as many times as you need

14 Views Asked by At

browser image

Array.from make this magic return 5 times an array, the propose is hard coded HTML:

 <q-table
  :rows="rows"
  :columns="columns"
  row-key="name"
/>


rows: Array.from({ length: 5 }, (v, i) => ({
    name: 'Bodega Yulissa 002',
    sesion: 'POS/001',
    date: DateTime.now().toFormat('D'),
    receipt: 'Orden 002-017-05',
    cashier: 'Murieta R..',
    total: 'S/ 0.70',
    status: 'Pagado'
  }))
1

There are 1 best solutions below

0
Angie Cristina On

Array.from make this magic return 5 times an array, the propose is hard code HTML:

   rows: Array.from({ length: 5 }, (v, i) => ({
    name: 'Bodega Yulissa 002',
    sesion: 'POS/001',
    date: DateTime.now().toFormat('D'),
    receipt: 'Orden 002-017-05',
    cashier: 'Murieta R..',
    total: 'S/ 0.70',
    status: 'Pagado'
  }))