2018-12-21 09:58:52 +08:00
|
|
|
|
/**
|
|
|
|
|
*
|
2019-04-16 13:35:25 +08:00
|
|
|
|
* @title 纵向滚动条
|
|
|
|
|
* @description 设置`scroll`属性支持横向或纵向滚动,x/y的取值可以是正整数、百分比、布尔值
|
2018-12-21 09:58:52 +08:00
|
|
|
|
*/
|
|
|
|
|
|
2019-04-16 13:35:25 +08:00
|
|
|
|
import React, { Component } from "react";
|
|
|
|
|
import Table from "../../src";
|
2019-03-20 17:44:05 +08:00
|
|
|
|
|
2019-04-16 13:35:25 +08:00
|
|
|
|
const columns12 = [
|
|
|
|
|
{
|
|
|
|
|
title: "Full Name",
|
|
|
|
|
width: 100,
|
|
|
|
|
dataIndex: "name",
|
|
|
|
|
key: "name"
|
|
|
|
|
},
|
|
|
|
|
{ title: "Age", width: 100, dataIndex: "age", key: "age"},
|
|
|
|
|
{ title: "Address", dataIndex: "address", key: "1" }
|
2018-12-21 09:58:52 +08:00
|
|
|
|
];
|
|
|
|
|
|
2019-04-16 13:35:25 +08:00
|
|
|
|
const data12 = [
|
|
|
|
|
{
|
|
|
|
|
key: "1",
|
|
|
|
|
name: "John Brown",
|
|
|
|
|
age: 32,
|
|
|
|
|
address: "New York Park"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: "2",
|
|
|
|
|
name: "Jim Green",
|
|
|
|
|
age: 40,
|
|
|
|
|
address: "London Park"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: "3",
|
|
|
|
|
name: "Jim Green",
|
|
|
|
|
age: 40,
|
|
|
|
|
address: "London Park"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: "4",
|
|
|
|
|
name: "Jim Green",
|
|
|
|
|
age: 40,
|
|
|
|
|
address: "London Park"
|
|
|
|
|
},{
|
|
|
|
|
key: "11",
|
|
|
|
|
name: "John Brown",
|
|
|
|
|
age: 32,
|
|
|
|
|
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"
|
2019-03-20 17:44:05 +08:00
|
|
|
|
}
|
2019-04-16 13:35:25 +08:00
|
|
|
|
];
|
|
|
|
|
class Demo12 extends Component {
|
2018-12-21 09:58:52 +08:00
|
|
|
|
render() {
|
2019-04-16 13:35:25 +08:00
|
|
|
|
return (
|
|
|
|
|
<Table bordered columns={columns12} data={data12} scroll={{y:150 }} />
|
|
|
|
|
);
|
2018-12-21 09:58:52 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-16 13:35:25 +08:00
|
|
|
|
export default Demo12;
|