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';
|
|
|
|
|
import Icon from 'bee-icon';
|
|
|
|
|
|
2019-04-16 13:35:25 +08:00
|
|
|
|
const columns02 = [
|
2019-04-15 20:14:02 +08:00
|
|
|
|
{
|
2019-04-18 15:31:24 +08:00
|
|
|
|
title: "员工编号",
|
|
|
|
|
dataIndex: "num",
|
|
|
|
|
key: "num",
|
2019-04-15 20:14:02 +08:00
|
|
|
|
width: "40%"
|
|
|
|
|
},
|
|
|
|
|
{
|
2019-04-18 15:31:24 +08:00
|
|
|
|
title: "员工姓名",
|
|
|
|
|
dataIndex: "name",
|
|
|
|
|
key: "name",
|
2019-04-15 20:14:02 +08:00
|
|
|
|
width: "30%"
|
|
|
|
|
},
|
|
|
|
|
{
|
2019-04-18 15:31:24 +08:00
|
|
|
|
title: "部门",
|
|
|
|
|
dataIndex: "department",
|
|
|
|
|
key: "department"
|
2019-04-15 20:14:02 +08:00
|
|
|
|
}
|
2019-04-18 15:31:24 +08:00
|
|
|
|
];
|
2019-04-15 20:14:02 +08:00
|
|
|
|
|
2019-04-18 15:31:24 +08:00
|
|
|
|
const data02 = [];
|
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={columns02}
|
|
|
|
|
data={data02}
|
|
|
|
|
// 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;
|