From 81979eb5741ee43b4204348001cf3b150ca0838f Mon Sep 17 00:00:00 2001 From: kvkens Date: Tue, 11 Sep 2018 15:50:10 +0800 Subject: [PATCH] =?UTF-8?q?remove:Demo1=E5=A4=9A=E4=BD=99css?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/demolist/Demo1.js | 71 ++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 37 deletions(-) diff --git a/demo/demolist/Demo1.js b/demo/demolist/Demo1.js index 2d49c0a..81b026c 100644 --- a/demo/demolist/Demo1.js +++ b/demo/demolist/Demo1.js @@ -11,21 +11,23 @@ import Tooltip from "bee-tooltip"; import Table from "../../src"; const columns = [ - { title: "用户名", dataIndex: "a", key: "a", width:80 , className:"rowClassName", - render: (text, record, index)=> { - return ( + { + title: "用户名", dataIndex: "a", key: "a", width: 80, className: "rowClassName", + render: (text, record, index) => { + return ( - {text} + {text} - ); - }}, + ); + } + }, { id: "123", title: "性别", dataIndex: "b", key: "b", width: 100 }, { title: "年龄", dataIndex: "c", key: "c", width: 200 }, { @@ -34,20 +36,15 @@ const columns = [ key: "d", render(text, record, index) { return ( -
- { - alert('这是第'+index+'列,内容为:'+text); - }} - style={{ - position: 'absolute', - top: 5, - left: 0 - }} - > - 一些操作 +
+ { + alert('这是第' + index + '列,内容为:' + text); + }} + > + 一些操作
); @@ -63,12 +60,12 @@ const data = [ class Demo1 extends Component { - constructor(props){ - super(props); - this.state = { - data: data, - selectedRowIndex: 0 - } + constructor(props) { + super(props); + this.state = { + data: data, + selectedRowIndex: 0 + } } render() { @@ -76,12 +73,12 @@ class Demo1 extends Component { { - this.setState({ - selectedRowIndex: index + onRowClick={(record, index, indent) => { + this.setState({ + selectedRowIndex: index }); }} - /> + /> ); } }