Fixed #2108 - Extend TreeNode API with expandedIcon & collapsedIcon
parent
7aab982030
commit
610e304404
|
@ -273,10 +273,7 @@ export default {
|
|||
return ['p-treenode-icon', this.node.icon];
|
||||
},
|
||||
toggleIcon() {
|
||||
return ['p-tree-toggler-icon pi pi-fw', {
|
||||
'pi-chevron-down': this.expanded,
|
||||
'pi-chevron-right': !this.expanded
|
||||
}];
|
||||
return ['p-tree-toggler-icon pi pi-fw', this.expanded ? this.node.expandedIcon || 'pi-chevron-down' : this.node.collapsedIcon || 'pi-chevron-right'];
|
||||
},
|
||||
checkboxClass() {
|
||||
return ['p-checkbox-box', {'p-highlight': this.checked, 'p-indeterminate': this.partialChecked}];
|
||||
|
|
|
@ -57,6 +57,18 @@ import Tree from 'primevue/tree';
|
|||
<td>null</td>
|
||||
<td>Icon of the node to display next to content.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>expandedIcon</td>
|
||||
<td>string</td>
|
||||
<td>null</td>
|
||||
<td>Icon to use in expanded state.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>collapsedIcon</td>
|
||||
<td>string</td>
|
||||
<td>null</td>
|
||||
<td>Icon to use in collapsed state.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>children</td>
|
||||
<td>TreeNode[]</td>
|
||||
|
|
Loading…
Reference in New Issue