脚本文件夹显示文件夹图标。

This commit is contained in:
tengge1 2020-03-11 20:25:05 +08:00
parent ae1d82f5d4
commit eee51966b9
2 changed files with 6 additions and 3 deletions

View File

@ -38,12 +38,14 @@ class ScriptPanel extends React.Component {
return {
value: n[0],
text: `${n[1].name}.${this.getExtension(n[1].type)}`,
leaf: false,
expanded: true
};
} else { //
return {
value: n[0],
text: `${n[1].name}.${this.getExtension(n[1].type)}`,
leaf: true,
icons: [{
name: 'edit',
value: n[0],

View File

@ -47,11 +47,12 @@ class Tree extends React.Component {
}
createNode(data) {
const leaf = !data.children || data.children.length === 0;
// TODO: leafleftchildren
const leaf = (!data.children || data.children.length === 0) && data.leaf !== false;
const children = leaf ? null : <ul className={classNames('sub', data.expanded ? null : 'collpase')}>{data.children.map(n => {
const children = data.children && data.children.length > 0 ? <ul className={classNames('sub', data.expanded ? null : 'collpase')}>{data.children.map(n => {
return this.createNode(n);
})}</ul>;
})}</ul> : null;
let checkbox = null;