antd里面的数据源的格式

import React, { Component } from 'react'
import { Table } from 'antd';

export default class index extends Component {
    render() {
        const dataSource = [
            ["微软", 'gh2', 3, 4],
            ['微软', 'gh2', 3, 4],
            ['微软', 'gh2', 3, 4],
            ['微软', 'gh2gh2gh2', 3, 4]
        ];

        const columns = [
            {
                title: '姓名',
                dataIndex: '0',
                key: '0',
            },
            {
                title: '年龄',
                dataIndex: '1',
                key: '1',
            },
            {
                title: '住址',
                dataIndex: '2',
                key: '2',
            },
        ];
        return (
            <div>
                <Table dataSource={dataSource} columns={columns} />
            </div>
        )
    }
}
漫思
原文地址:https://www.cnblogs.com/sexintercourse/p/15437775.html