From 4659d4230aaf2551a355c44c2d6ac5fd2e3bbf6f Mon Sep 17 00:00:00 2001 From: xyf-mac Date: Sat, 30 Oct 2021 16:18:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4node=E4=B8=8D=E6=8A=98?= =?UTF-8?q?=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/src/devtools/propertys.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/src/devtools/propertys.vue b/source/src/devtools/propertys.vue index 54e393a..f7b836d 100644 --- a/source/src/devtools/propertys.vue +++ b/source/src/devtools/propertys.vue @@ -33,7 +33,7 @@ export default class properties extends Vue { allGroup: Array> | undefined; onClickHeader(group: any) { - if (group && group.hasOwnProperty('fold')) { + if (group && group.hasOwnProperty("fold")) { group.fold = !group.fold; } } @@ -45,7 +45,7 @@ export default class properties extends Vue { } - @Watch('allGroup') + @Watch("allGroup") watchAllGroup() { this._initValue(); } @@ -56,9 +56,11 @@ export default class properties extends Vue { _initValue() { if (this.allGroup) { - this.allGroup.forEach(item => { - this.$set(item, 'fold', false); - }) + // 第一个cc.Node不折叠 + for (let i = 0; i < this.allGroup.length; i++) { + let item = this.allGroup[i]; + this.$set(item, "fold", i !== 0); + } } }