Comparing version 0.0.13 to 0.0.14
@@ -19,5 +19,5 @@ import React from 'react'; | ||
if (isTh) { | ||
return <th key={`th_${Math.random()}`} style={style}>{tdDom}</th>; | ||
return <th key={`th_${Math.random()}`} style={style} {...td.attr}>{tdDom}</th>; | ||
} else { | ||
return <td key={`td_${Math.random()}`} style={style}>{tdDom}</td>; | ||
return <td key={`td_${Math.random()}`} style={style} {...td.attr}>{tdDom}</td>; | ||
} | ||
@@ -39,6 +39,11 @@ | ||
const tds = trs.map(td => this.getTdContent(td)); | ||
return <tr style={BodyStyle} key={`tableBody${trindex}`}>{tds}</tr>; | ||
return <tr style={BodyStyle} key={`tableBody${trindex}`} onClick={this.click.bind(this, trs, trindex)}>{tds}</tr>; | ||
}) | ||
} | ||
click(item, index) { | ||
const clickEvt = this.props.dataSource && this.props.dataSource.body && this.props.dataSource.body.click; | ||
clickEvt && clickEvt(item, index); | ||
} | ||
render() { | ||
@@ -45,0 +50,0 @@ const tableStyle = this.props.dataSource.style || {}; |
{ | ||
"name": "hui-ui", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "hui-ui", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
154813
307