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];
|
return ['p-treenode-icon', this.node.icon];
|
||||||
},
|
},
|
||||||
toggleIcon() {
|
toggleIcon() {
|
||||||
return ['p-tree-toggler-icon pi pi-fw', {
|
return ['p-tree-toggler-icon pi pi-fw', this.expanded ? this.node.expandedIcon || 'pi-chevron-down' : this.node.collapsedIcon || 'pi-chevron-right'];
|
||||||
'pi-chevron-down': this.expanded,
|
|
||||||
'pi-chevron-right': !this.expanded
|
|
||||||
}];
|
|
||||||
},
|
},
|
||||||
checkboxClass() {
|
checkboxClass() {
|
||||||
return ['p-checkbox-box', {'p-highlight': this.checked, 'p-indeterminate': this.partialChecked}];
|
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>null</td>
|
||||||
<td>Icon of the node to display next to content.</td>
|
<td>Icon of the node to display next to content.</td>
|
||||||
</tr>
|
</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>
|
<tr>
|
||||||
<td>children</td>
|
<td>children</td>
|
||||||
<td>TreeNode[]</td>
|
<td>TreeNode[]</td>
|
||||||
|
|
Loading…
Reference in New Issue