customRender: (value, row, index) => {
let _this = this;
if(row.editable){
let option = _this.taskTree.map((item) => (
<a-select-option key={item.key} value={item.key}>
{item.title}
</a-select-option>
))
let op = <a-select style="width: -webkit-fill-available" label-in-value defaultValue={row.taskId}
onChange={(value) => _this.handleSelectChange(value, row)} show-search
filterOption={(inputValue, option) =>
option.componentOptions.children[0].text.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0
}>
{option}
</a-select>
return op;
}
}
antdesign a-table customRender返回一个自定义内容,比如:a-select
最新推荐文章于 2024-08-08 13:46:49 发布
文章介绍了如何在定制渲染中使用React的<a-select>组件,实现一个可编辑的下拉列表,用于任务树的选择,包括onChange事件处理和filterOption筛选功能。
摘要由CSDN通过智能技术生成