/**
*
* @title 大数据加载
* 【Tooltip】
* @description
*/
import React, { Component } from "react";
import Tooltip from "bee-tooltip";
import Table from "../../src";
import BigData from "../../src/lib/bigData";
const BigDataTable = BigData(Table);
const columns = [
{
title:'序号',
dataIndex:'index',
width:'50',
render:(text,record,index)=>{
return index
},
fixed:'left'
},
{
title: "用户名", dataIndex: "a", key: "a", width: 580, className: "rowClassName",
render: (text, record, index) => {
return (
{text}
);
}
},
{ id: "123", title: "性别", dataIndex: "b", key: "b", width: 80},
{ title: "年龄", dataIndex: "c", key: "c", width: 200 },
{
title: "操作",
dataIndex: "d",
key: "d",
fixed:'right',
render(text, record, index) {
return (
);
}
}
];
const data = [ ...new Array(20) ].map((e, i) => {
const rs = { a: i + 'a', b: i + 'b', c: i + 'c', d: i + 'd', key: i };
if(i%3==0){
rs.b = '女';
}
return rs;
})
class Demo30 extends Component {
constructor(props) {
super(props);
this.state = {
data: data,
selectedRowIndex: 0
}
}
add=()=>{
let {data} = this.state;
const len =data.length;
data.push({a: len + 'a', b: len+ 'b', c: len + 'c', d: len + 'd', key: len });
this.setState({
data
});
}
render() {
return (
{
console.log('currentIndex--'+index);
}}
/>
);
}
}
export default Demo30;