console
const {Button, Table} = antd;
class App extends React.Component {
handleClick = () => {
alert('clicked')
}
render() {
const dataSource = [];
const columns = [{
title: '名称',
dataIndex: 'name',
key: 'name',
}, {
title: 'desc',
dataIndex: 'desc',
key: 'desc',
}, {
title: '类型',
dataIndex: 'type',
key: 'type',
}, {
title: '初始值',
dataIndex: 'initValue',
key: 'initValue',
}, {
title: '是否内置',
dataIndex: 'builtIn',
key: 'builtIn',
}];
return (
<div>
<Button type="primary" onClick={this.handleClick}>新建</Button>
<Table
columns={columns}
dataSource={dataSource}
/>
</div>
)
}
}
ReactDOM.render(<App/>, document.getElementById('root'))
<div id='root'></div>