From dd6a9fff54298193ed7cfd69cd908a83997c5439 Mon Sep 17 00:00:00 2001 From: Next <1406099478@qq.com> Date: Fri, 28 Dec 2018 19:30:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E6=8E=89=E5=B7=A5=E5=85=B7=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E6=97=B6=E5=8F=96=E6=B6=88=E5=9C=BA=E6=99=AF=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E9=81=BF=E5=85=8D=E9=87=8D=E5=A4=8D=E6=B3=A8?= =?UTF-8?q?=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index f8cdd85..9184b72 100644 --- a/index.html +++ b/index.html @@ -31,11 +31,11 @@
-
+
- @@ -152,15 +152,11 @@
-
- +
+ - +
@@ -213,12 +209,12 @@ }, outputNodeHandler(target) { let i = 1; - while(window['temp'+i] !== undefined) { + while (window['temp' + i] !== undefined) { i++; } - window['temp'+i] = this.$data.node; + window['temp' + i] = this.$data.node; console.log('temp' + i); - console.log(window['temp'+i]); + console.log(window['temp' + i]); }, outputComponentHandler(target) { // TODO @@ -247,11 +243,11 @@ cc.director.on(cc.Director.EVENT_AFTER_SCENE_LAUNCH, () => { this.$data.sceneTreeData = cc.director.getScene().children; this.defaultExpandedKeys = [this.$data.sceneTreeData[0]._id]; - }); + }, this); cc.director.on(cc.Director.EVENT_BEFORE_SCENE_LOADING, () => { this.$data.sceneTreeData = []; this.$data.node = null; - }); + }, this); clearInterval(this.$data.intervalId); } else { console.log('cc is not init'); @@ -261,12 +257,15 @@ setTimeout(initWin, 0); }, closeDevMode() { + this.$data.node = null; + this.$data.sceneTreeData = []; + cc.director.targetOff(this); clearInterval(this.$data.intervalId); document.body.appendChild(document.getElementsByClassName('toolbar')[0]); document.body.appendChild(document.getElementById('content')); }, handleChangeMode(data) { - data?this.openDevMode():this.closeDevMode(); + data ? this.openDevMode() : this.closeDevMode(); } }, watch: { @@ -274,8 +273,15 @@ this.$refs.sceneTree.filter(val); } }, - created: function() { + created: function () { + let toolbar = document.getElementsByClassName('toolbar')[0]; + // toolbar.insertBefore(document.getElementById('dev_switch'), toolbar.firstChild); document.body.insertBefore(document.getElementById('app'), document.body.firstChild); } }); + + \ No newline at end of file