How to create a new line in the Table of ant design

clipboard.png

clipboard.png
this is the effect

Mar.01,2021

the following list should be a list. When you create a new one, add an empty data to the list, and the list will automatically add a row of data.
as a rule of thumb, the addition must ensure the uniqueness of key .


clipboard.png
the following data is the data obtained by antdesign's table using columns


Click the add button to add an entry to the dataSource array, and update it

handleAdd = () => {
    const { count, dataSource } = this.state;
    const newData = {
      key: count,
      name: `Allan ${count}`,
      age: 22,
      address: `China, Hangzhou. ${count}`,
    };
    this.setState({
      dataSource: [...dataSource, newData],
      count: count + 1,
    });
}

if ps: is deleted, see the following

onDelete = (key) => {
    const dataSource = [...this.state.dataSource];
    this.setState({ dataSource: dataSource.filter(item => item.key !== key)    });
}
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-1c26e0c-3bbcf.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-1c26e0c-3bbcf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?