bee-table7/demo/demolist/Demo0105.js

59 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

2019-04-15 20:14:02 +08:00
/**
*
* @title 表格 Loading 加载
2019-04-18 10:50:38 +08:00
* @parent 基础 Basic
* @description loading可以传boolean或者object对象object为bee-loading组件的参数类型
2019-04-23 20:11:38 +08:00
* demo0105
2019-04-15 20:14:02 +08:00
*/
import React, { Component } from "react";
import Table from "../../src";
import {Button,Tooltip} from "tinper-bee";
2019-04-15 20:14:02 +08:00
2019-04-16 13:35:25 +08:00
const columns05 = [
{ title: "员工编号", dataIndex: "a", key: "a", width: 300, className: "rowClassName",fixed:'left'},
{ title: "员工姓名", dataIndex: "b", key: "b", width: 500 },
{ title: "性别", dataIndex: "c", key: "c", width: 500 },
{ title: "部门", dataIndex: "d", key: "d", width: 200 }
2019-04-15 20:14:02 +08:00
];
2019-04-16 13:35:25 +08:00
const data05 = [
{ a: "ASVAL_201903280005", b: "小张", c: "男", d: "财务二科", key: "1" },
{ a: "ASVAL_201903200004", b: "小明", c: "男", d: "财务一科", key: "2" },
{ a: "ASVAL_201903120002", b: "小红", c: "女", d: "财务一科", key: "3" }
2019-04-15 20:14:02 +08:00
];
2019-04-16 13:35:25 +08:00
class Demo05 extends Component {
2019-04-15 20:14:02 +08:00
constructor(props){
super(props);
this.state = {
loading : true
}
}
changeLoading = () => {
this.setState({
loading : !this.state.loading
})
}
render() {
return (
<div>
<Button
className="editable-add-btn"
onClick={this.changeLoading}
>
切换loading
</Button>
<Table
2019-04-16 13:35:25 +08:00
columns={columns05}
data={data05}
2019-04-15 20:14:02 +08:00
// loading={this.state.loading}或者是boolean
loading={{show:this.state.loading}}
/>
</div>
);
}
}
2019-04-16 13:35:25 +08:00
export default Demo05;