fix: inputTree的icon显示修复 (#2641)

Co-authored-by: AegeanSeaBlue <2285105697@qq.com>
This commit is contained in:
AegeanSeaBlue 2021-09-30 19:36:59 +08:00 committed by GitHub
parent 80f9de08d2
commit 4f0ef7f04f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -985,14 +985,17 @@ export default {
type: 'input-tree',
name: 'tree',
label: '树',
iconField: 'icon',
options: [
{
label: 'Folder A',
value: 1,
icon: 'fa fa-bookmark',
children: [
{
label: 'file A',
value: 2
value: 2,
icon: 'fa fa-star'
},
{
label: 'file B',

View File

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

View File

@ -147,6 +147,7 @@ export default class TreeControl extends React.Component<TreeProps> {
rootCreatable,
rootCreateTip,
labelField,
iconField,
nodePath,
deferLoad,
expandTreeOptions,
@ -163,6 +164,7 @@ export default class TreeControl extends React.Component<TreeProps> {
classPrefix={ns}
labelField={labelField}
valueField={valueField}
iconField={iconField}
disabled={disabled}
onChange={onChange}
joinValues={joinValues}