修改多选实例,增加回调函数说明

This commit is contained in:
izbz wh 2019-04-09 11:41:34 +08:00
parent bb7fddd47b
commit acf29b253a
4 changed files with 42 additions and 7 deletions

View File

@ -54,8 +54,26 @@ class Demo12 extends Component {
data: data12
};
}
getSelectedDataFunc = data => {
console.log(data);
/**
*@param selectedList:当前选中的行数据
*@param record 当前操作行数据
*@param index 当前操作行索引
* @memberof Demo12
*/
getSelectedDataFunc = (selectedList,record,index) => {
console.log("selectedList", selectedList,"index",index);
// 如果在回调中增加setState逻辑需要同步data中的_checked属性。即下面的代码
const allChecked = selectedList.length == 0?false:true;
// record为undefind则为全选或者全不选
// if(!record){
// data12.forEach(item=>{
// item._checked = allChecked;
// })
// }else{
// data12[index]['_checked'] = record._checked;
// }
};
render() {

File diff suppressed because one or more lines are too long

23
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long