mirror of
https://github.com/potato47/ccc-devtools.git
synced 2024-12-26 11:49:11 +00:00
保存开关状态
This commit is contained in:
parent
272af4381b
commit
02e9fe7b2e
@ -1,4 +1,4 @@
|
|||||||
# ccc-devtools v1.2.3
|
# ccc-devtools v1.2.4
|
||||||
Cocos Creator 网页调试器,运行时查看、修改节点树,实时更新节点属性。
|
Cocos Creator 网页调试器,运行时查看、修改节点树,实时更新节点属性。
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
17
index.html
17
index.html
@ -155,7 +155,7 @@
|
|||||||
<div id="dev_switch" style="position: absolute;top:45px;left:10px;width: 200px;">
|
<div id="dev_switch" style="position: absolute;top:45px;left:10px;width: 200px;">
|
||||||
<el-switch v-model="isDevMode" @change="handleChangeMode" active-color="#0099ff" inactive-color="gray">
|
<el-switch v-model="isDevMode" @change="handleChangeMode" active-color="#0099ff" inactive-color="gray">
|
||||||
</el-switch>
|
</el-switch>
|
||||||
<el-tooltip :content="'ccc-devtools@Next v1.2.3'" placement="top">
|
<el-tooltip :content="'ccc-devtools@Next v1.2.4'" placement="top">
|
||||||
<Icon type="logo-github" size="24" @click="openGithub" />
|
<Icon type="logo-github" size="24" @click="openGithub" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
@ -230,11 +230,8 @@
|
|||||||
let initWin = () => {
|
let initWin = () => {
|
||||||
if (window.cc) {
|
if (window.cc) {
|
||||||
let top = document.getElementById('top')
|
let top = document.getElementById('top')
|
||||||
// top.insertBefore(document.getElementsByClassName('toolbar')[0], top.firstChild);
|
|
||||||
top.appendChild(document.getElementsByClassName('toolbar')[0]);
|
top.appendChild(document.getElementsByClassName('toolbar')[0]);
|
||||||
document.getElementById('game_panel').appendChild(document.getElementById('content'));
|
document.getElementById('game_panel').appendChild(document.getElementById('content'));
|
||||||
// let content = document.getElementById('content');
|
|
||||||
// content.insertBefore(document.getElementById('searchInput'), content.firstChild);
|
|
||||||
let scene = cc.director.getScene();
|
let scene = cc.director.getScene();
|
||||||
if (scene) {
|
if (scene) {
|
||||||
this.$data.sceneTreeData = scene.children;
|
this.$data.sceneTreeData = scene.children;
|
||||||
@ -250,11 +247,12 @@
|
|||||||
}, this);
|
}, this);
|
||||||
clearInterval(this.$data.intervalId);
|
clearInterval(this.$data.intervalId);
|
||||||
} else {
|
} else {
|
||||||
console.log('cc is not init');
|
// console.log('cc is not init');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.$data.intervalId = setInterval(initWin, 500);
|
this.$data.intervalId = setInterval(initWin, 500);
|
||||||
setTimeout(initWin, 0);
|
setTimeout(initWin, 0);
|
||||||
|
localStorage.setItem('isDevMode', 1);
|
||||||
},
|
},
|
||||||
closeDevMode() {
|
closeDevMode() {
|
||||||
this.$data.node = null;
|
this.$data.node = null;
|
||||||
@ -263,6 +261,7 @@
|
|||||||
clearInterval(this.$data.intervalId);
|
clearInterval(this.$data.intervalId);
|
||||||
document.body.appendChild(document.getElementsByClassName('toolbar')[0]);
|
document.body.appendChild(document.getElementsByClassName('toolbar')[0]);
|
||||||
document.body.appendChild(document.getElementById('content'));
|
document.body.appendChild(document.getElementById('content'));
|
||||||
|
localStorage.setItem('isDevMode', 0);
|
||||||
},
|
},
|
||||||
handleChangeMode(data) {
|
handleChangeMode(data) {
|
||||||
data ? this.openDevMode() : this.closeDevMode();
|
data ? this.openDevMode() : this.closeDevMode();
|
||||||
@ -274,9 +273,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
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);
|
document.body.insertBefore(document.getElementById('app'), document.body.firstChild);
|
||||||
|
if (localStorage.getItem('isDevMode') === "1") {
|
||||||
|
this.$data.isDevMode = true;
|
||||||
|
this.openDevMode();
|
||||||
|
} else {
|
||||||
|
this.$data.isDevMode = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user