remove:Demo1多余css

This commit is contained in:
kvkens 2018-09-11 15:50:10 +08:00
parent 941c791f3f
commit 81979eb574
1 changed files with 34 additions and 37 deletions

View File

@ -11,21 +11,23 @@ import Tooltip from "bee-tooltip";
import Table from "../../src"; import Table from "../../src";
const columns = [ const columns = [
{ title: "用户名", dataIndex: "a", key: "a", width:80 , className:"rowClassName", {
render: (text, record, index)=> { title: "用户名", dataIndex: "a", key: "a", width: 80, className: "rowClassName",
return ( render: (text, record, index) => {
return (
<Tooltip inverse overlay={text}> <Tooltip inverse overlay={text}>
<span tootip={text} style={{ <span tootip={text} style={{
display: "inline-block", display: "inline-block",
width: "100px", width: "100px",
textOverflow:"ellipsis", textOverflow: "ellipsis",
overflow:"hidden", overflow: "hidden",
whiteSpace:"nowrap", whiteSpace: "nowrap",
verticalAlign: "middle", verticalAlign: "middle",
}}>{text}</span> }}>{text}</span>
</Tooltip> </Tooltip>
); );
}}, }
},
{ id: "123", title: "性别", dataIndex: "b", key: "b", width: 100 }, { id: "123", title: "性别", dataIndex: "b", key: "b", width: 100 },
{ title: "年龄", dataIndex: "c", key: "c", width: 200 }, { title: "年龄", dataIndex: "c", key: "c", width: 200 },
{ {
@ -34,20 +36,15 @@ const columns = [
key: "d", key: "d",
render(text, record, index) { render(text, record, index) {
return ( return (
<div style={{position: 'relative'}} title={text} > <div style={{ position: 'relative' }} title={text} >
<a <a
href="#" href="javascript:;"
tooltip={text} tooltip={text}
onClick={() => { onClick={() => {
alert('这是第'+index+'列,内容为:'+text); alert('这是第' + index + '列,内容为:' + text);
}} }}
style={{ >
position: 'absolute', 一些操作
top: 5,
left: 0
}}
>
一些操作
</a> </a>
</div> </div>
); );
@ -63,12 +60,12 @@ const data = [
class Demo1 extends Component { class Demo1 extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.state = { this.state = {
data: data, data: data,
selectedRowIndex: 0 selectedRowIndex: 0
} }
} }
render() { render() {
@ -76,12 +73,12 @@ class Demo1 extends Component {
<Table <Table
columns={columns} columns={columns}
data={data} data={data}
onRowClick={(record,index,indent)=>{ onRowClick={(record, index, indent) => {
this.setState({ this.setState({
selectedRowIndex: index selectedRowIndex: index
}); });
}} }}
/> />
); );
} }
} }