Use vue+elment to complete the page, about the question of tabular data display

[b] I got data similar to the following through the database,
title
detailtitle

elment :data=" list"


.

ask all the bosses for help. It has been stuck for almost a day [/ b]


question: why is the data design like this? it's obviously wrong.

data:

let list = [
    {title: '', detail: ''},
    {title: '', detail: ''},
];

idea:
1. Integrate the header after getting the data

let columnData = list.map(item => ({
  prop: item.title,
  label: item.title
}));

2. Extract data (field name is header)

let dataSource = list.reduce((data, record) => {
  data[record.title] = record.detail;
  return data;
}, {});
dataSource = [dataSource];

3. Modify el-table-column

<el-table-column
  v-for="column in columnData"
  :prop="column.prop"
  :label="column.label"
></el-table-column>

4, effect

clipboard.png


the same floor asks why the data design is like this, obviously wrong.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b350bf-2bf7c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b350bf-2bf7c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?