bee-table/demo/demolist/Demo0104.js

83 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-12-21 09:58:52 +08:00
/**
*
2019-04-15 20:14:02 +08:00
* @title 隔行换色
2019-04-18 10:50:38 +08:00
* @parent 基础 Basic
2019-04-15 20:14:02 +08:00
* @description 可自定义斑马线颜色
2018-12-21 09:58:52 +08:00
*
*/
import React, { Component } from 'react';
import Table from '../../src';
2019-04-16 13:35:25 +08:00
const columns04 = [
2018-12-21 09:58:52 +08:00
{
title: "员工姓名",
2019-03-20 17:44:05 +08:00
width: 100,
2018-12-21 09:58:52 +08:00
dataIndex: "name",
2019-03-20 17:44:05 +08:00
key: "name"
2018-12-21 09:58:52 +08:00
},
{ title: "年龄", width: 100, dataIndex: "age", key: "age"},
{ title: "住址", dataIndex: "address", key: "1" }
2019-03-20 17:44:05 +08:00
];
2019-04-16 13:35:25 +08:00
const data04 = [
2018-12-21 09:58:52 +08:00
{
2019-03-20 17:44:05 +08:00
key: "1",
name: "John Brown",
age: 32,
address: "New York Park"
2018-12-21 09:58:52 +08:00
},
{
2019-03-20 17:44:05 +08:00
key: "2",
name: "Jim Green",
age: 40,
address: "London Park"
},
2018-12-21 09:58:52 +08:00
{
2019-03-20 17:44:05 +08:00
key: "3",
name: "Jim Green",
age: 40,
address: "London Park"
2018-12-21 09:58:52 +08:00
},
{
2019-03-20 17:44:05 +08:00
key: "4",
name: "Jim Green",
age: 40,
address: "London Park"
},{
key: "11",
name: "John Brown",
2018-12-21 09:58:52 +08:00
age: 32,
2019-03-20 17:44:05 +08:00
address: "New York Park"
},
{
key: "12",
name: "Jim Green",
age: 40,
address: "London Park"
},
{
key: "13",
name: "Jim Green",
age: 40,
address: "London Park"
},
{
key: "14",
name: "Jim Green",
age: 40,
address: "London Park"
2018-12-21 09:58:52 +08:00
}
];
2019-04-15 20:14:02 +08:00
class Demo04 extends Component {
2018-12-21 09:58:52 +08:00
render() {
return <Table
className="demo04"
columns={columns04}
2019-04-19 15:46:04 +08:00
data={data04} />
2018-12-21 09:58:52 +08:00
}
}
2019-04-15 20:14:02 +08:00
export default Demo04;