mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
脚本文件夹显示文件夹图标。
This commit is contained in:
parent
ae1d82f5d4
commit
eee51966b9
@ -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],
|
||||
|
||||
@ -47,11 +47,12 @@ class Tree extends React.Component {
|
||||
}
|
||||
|
||||
createNode(data) {
|
||||
const leaf = !data.children || data.children.length === 0;
|
||||
// TODO: leaf应该根据数据上的left属性判断,而不是children。
|
||||
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;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user