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