【问题标题】:how to return an array as many times as you need如何根据需要多次返回数组
【发布时间】:2021-11-22 16:52:25
【问题描述】:

Array.from 让这个魔法返回 5 次数组,建议是硬编码 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'
  }))

【问题讨论】:

    标签: arrays time-series hardcoded


    【解决方案1】:

    Array.from 让这个魔法返回 5 次数组,建议是硬编码 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'
      }))
    

    【讨论】:

      猜你喜欢
      • 2020-03-19
      • 1970-01-01
      • 1970-01-01
      • 2019-04-29
      • 2015-08-20
      • 2021-12-05
      • 2021-09-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多