inputTree的icon显示修复;并补充文档 (#2849)

Co-authored-by: zhyc <zhyc@hzsuoyi.com>
This commit is contained in:
decarp 2021-11-04 11:24:52 +08:00 committed by GitHub
parent f32c6b7605
commit a9446ed34c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -746,6 +746,7 @@ true false true [{label: 'A/B/C', value: 'a/b/c'},{label: 'A
| delimeter | `string` | `false` | [拼接符](./options#%E6%8B%BC%E6%8E%A5%E7%AC%A6-delimiter) |
| labelField | `string` | `"label"` | [选项标签字段](./options#%E9%80%89%E9%A1%B9%E6%A0%87%E7%AD%BE%E5%AD%97%E6%AE%B5-labelfield) |
| valueField | `string` | `"value"` | [选项值字段](./options#%E9%80%89%E9%A1%B9%E5%80%BC%E5%AD%97%E6%AE%B5-valuefield) |
| iconField | `string` | `"icon"` | 图标值字段 |
| joinValues | `boolean` | `true` | [拼接值](./options#%E6%8B%BC%E6%8E%A5%E5%80%BC-joinvalues) |
| extractValue | `boolean` | `false` | [提取值](./options#%E6%8F%90%E5%8F%96%E5%A4%9A%E9%80%89%E5%80%BC-extractvalue) |
| creatable | `boolean` | `false` | [新增选项](./options#%E5%89%8D%E7%AB%AF%E6%96%B0%E5%A2%9E-creatable) |

View File

@ -765,12 +765,10 @@ export class TreeSelector extends React.Component<
: this.handleSelect(item))
}
>
{item[iconField] ? null : (
<Icon
icon={childrenItems ? 'folder' : 'file'}
className="icon"
/>
)}
<Icon
icon={item[iconField] || (childrenItems ? 'folder' : 'file')}
className="icon"
/>
</i>
) : null}