Skip to content

Commit 4dabd69

Browse files
committed
tree.List: createItem() => only add a record.iconCls in case it exists #6801
1 parent 2d20b66 commit 4dabd69

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/tree/List.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,15 @@ class Tree extends Base {
184184
let me = this,
185185
{folderCls, itemCls} = me,
186186
cls = [itemCls],
187+
contentCls = [itemCls + '-content'],
187188
itemVdom;
188189

190+
if (record.iconCls) {
191+
contentCls.push(
192+
Array.isArray(record.iconCls) ? record.iconCls : record.iconCls.split(' ')
193+
)
194+
}
195+
189196
if (record.isLeaf) {
190197
cls.push(itemCls + (record.singleton ? '-leaf-singleton' : '-leaf'))
191198
} else {
@@ -202,7 +209,7 @@ class Tree extends Base {
202209
id : me.getItemId(record.id),
203210
cn : [{
204211
tag : 'span',
205-
cls : [itemCls + '-content', record.iconCls],
212+
cls : contentCls,
206213
innerHTML: record.name,
207214
style : {pointerEvents: 'none'}
208215
}],

0 commit comments

Comments
 (0)