bee-table7/demo/demolist/Demo0102.js

50 lines
915 B
JavaScript
Raw Normal View History

2019-04-15 20:14:02 +08:00
/**
*
* @title 默认无数据展示
2019-04-18 10:50:38 +08:00
* @parent 基础 Basic
2019-04-23 20:11:38 +08:00
* @description 无数据时默认展示图标可在`emptyText`方法中自定义展示内容
* demo0102
2019-04-15 20:14:02 +08:00
*/
import React, { Component } from 'react';
import Table from '../../src';
const columns = [
2019-04-15 20:14:02 +08:00
{
title: "员工编号",
dataIndex: "num",
key: "num",
2019-04-15 20:14:02 +08:00
width: "40%"
},
{
title: "员工姓名",
dataIndex: "name",
key: "name",
2019-04-15 20:14:02 +08:00
width: "30%"
},
{
title: "部门",
dataIndex: "department",
key: "department"
2019-04-15 20:14:02 +08:00
}
];
2019-04-15 20:14:02 +08:00
const data = [];
2019-04-15 20:14:02 +08:00
2019-04-23 20:11:38 +08:00
// 在此自定义无数据时的展示内容
const emptyFunc = () => 'No Data';
2019-04-15 20:14:02 +08:00
2019-04-16 13:35:25 +08:00
class Demo02 extends Component {
render() {
2019-04-23 20:11:38 +08:00
return (
<Table
columns={columns}
data={data}
2019-04-23 20:11:38 +08:00
// emptyText={emptyFunc}
/>
)
2019-04-15 20:14:02 +08:00
}
2019-04-16 13:35:25 +08:00
}
2019-04-15 20:14:02 +08:00
2019-04-16 13:35:25 +08:00
export default Demo02;