序号增加类型,可支持数字和单字母序号
This commit is contained in:
parent
863ca7e905
commit
80c2ca8a8b
16
src/Table.js
16
src/Table.js
|
@ -682,7 +682,21 @@ class Table extends Component {
|
|||
for (let i = 0; i < data.length; i++) {
|
||||
let isHiddenExpandIcon;
|
||||
if ( props.showRowNum ){
|
||||
data[i][props.showRowNum.key || '_index'] = i + (props.showRowNum.base || 0);
|
||||
switch(props.showRowNum.type){
|
||||
case 'number':{
|
||||
data[i][props.showRowNum.key || '_index'] = i + (props.showRowNum.base || 0);
|
||||
break;
|
||||
}
|
||||
case 'ascii': {
|
||||
data[i][props.showRowNum.key || '_index'] = String.fromCharCode(i + (props.showRowNum.base || 0).charCodeAt());
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
data[i][props.showRowNum.key || '_index'] = i + (props.showRowNum.base || 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
const record = data[i];
|
||||
const key = this.getRowKey(record, i);
|
||||
|
|
Loading…
Reference in New Issue