Search code examples
typescript

Type script definition for rows and columns of Quasar QTable


I was wondering if there is a typescript definition for rows and columns of Qtable ? Thanks in advance marnold


Solution

  • You can use QTableProps['columns'] and QTableProps['rows'].

    const columns: QTableProps['columns'] = [
      {
        name: 'number',
        align: 'center',
        label: 'ID',
        field: 'number',
        sortable: true,
      }
    ];
    

     

    const rows: QTableProps['rows'] = [
      { id: 1, name: 'Frozen Yogurt', calories: 159}
    ];