no message

This commit is contained in:
许彦峰
2019-03-18 18:03:07 +08:00
parent ffc404b67a
commit c293754259
8 changed files with 97 additions and 31 deletions

View File

@@ -129,17 +129,14 @@
</ui-prop>
<!--颜色-->
<ui-prop name="color">
<div style="float: left;width: 100%;height: 100%;">
<div style="float: left;width: 50%; height: 100%;">
<el-color-picker v-model="itemData.color" size="mini"
style="margin: 0;display: flex;align-items: center;flex-wrap: wrap;"
@change="changeColor"></el-color-picker>
</div>
<div style="float: left;width: 50%;">
<span>{{itemData.color}}</span>
</div>
</div>
<div style="display: flex;flex-direction: row;justify-content: center;">
<div style="display: flex;flex:1;">
<el-color-picker v-model="itemData.color" size="mini" style="flex:1;margin: 0;" @change="changeColor"></el-color-picker>
</div>
<span style="width: 60px;">{{itemData.color}}</span>
</div>
</ui-prop>
</div>
</template>
@@ -177,7 +174,7 @@
// console.log("change changePositionX:" + this.itemData.x);
// console.log("change changePositionY:" + this.itemData.y);
this._evalCode(
"window.pluginSetNodePosition(" +
"window.ccinspector.pluginSetNodePosition(" +
"'" + this.itemData.uuid + "'," +
"'" + this.itemData.x + "'," +
"'" + this.itemData.y + "'" +
@@ -188,7 +185,7 @@
// console.log("change width:" + this.itemData.width);
// console.log("change height:" + this.itemData.height);
this._evalCode(
"window.pluginSetNodeSize(" +
"window.ccinspector.pluginSetNodeSize(" +
"'" + this.itemData.uuid + "'," +
"'" + this.itemData.width + "'," +
"'" + this.itemData.height + "'" +
@@ -198,7 +195,7 @@
changeRotation() {
console.log("change rotation:" + this.itemData.rotation);
this._evalCode(
"window.pluginSetNodeRotation('" +
"window.ccinspector.pluginSetNodeRotation('" +
this.itemData.uuid + "','" +
this.itemData.rotation + "')");
this._freshNode();
@@ -207,7 +204,7 @@
let color = this.itemData.color;
console.log("color:" + color);
this._evalCode(
"window.pluginSetNodeColor('" +
"window.ccinspector.pluginSetNodeColor('" +
this.itemData.uuid + "','" +
color + "');");
this._freshNode();
@@ -215,7 +212,7 @@
onBtnClickNodeHide() {
let uuid = this.itemData.uuid;
if (uuid !== undefined) {
let code = "window.pluginSetNodeActive('" + uuid + "', 0);";
let code = "window.ccinspector.pluginSetNodeActive('" + uuid + "', 0);";
this._evalCode(code);
this._freshNode();
}
@@ -223,14 +220,14 @@
onBtnClickNodeShow() {
let uuid = this.itemData.uuid;
if (uuid !== undefined) {
let code = "window.pluginSetNodeActive('" + uuid + "', 1);";
let code = "window.ccinspector.pluginSetNodeActive('" + uuid + "', 1);";
this._evalCode(code);
this._freshNode();
}
},
_freshNode() {
let uuid = this.itemData.uuid;
let code2 = "window.getNodeInfo('" + uuid + "')";
let code2 = "window.ccinspector.getNodeInfo('" + uuid + "')";
this._evalCode(code2);
},
_evalCode(code) {

View File

@@ -4,7 +4,12 @@
<div>
<el-button type="success" size="mini" @click="onBtnClickTest1">Test1</el-button>
<el-button type="success" size="mini" @click="onBtnClickTest2">Test2</el-button>
<el-button type="success" size="mini" @click="onBtnClickTest3">Test3</el-button>
<el-button type="success" size="mini" @click="onMemoryTest">内存测试</el-button>
</div>
<div>
<span>JS堆栈限制: {{memory.performance.jsHeapSizeLimit}}</span>
<span>JS堆栈大小: {{memory.performance.totalJSHeapSize}}</span>
<span>JS堆栈使用: {{memory.performance.usedJSHeapSize}}</span>
</div>
<el-row style="display:flex; flex: 1;">
<el-col :span="8">
@@ -56,6 +61,10 @@
label: 'label'
},
watchEveryTime: false,// 实时监控节点树
memory: {
performance: {},
console: {},
},
}
},
created() {
@@ -76,6 +85,8 @@
} else if (eventMsg === PluginMsg.Msg.NodeInfo) {
this.isShowDebug = true;
this.treeItemData = eventData;
} else if (eventMsg === PluginMsg.Msg.MemoryInfo) {
this.memory = eventData;
}
}.bind(this));
@@ -202,8 +213,7 @@
}`;
console.log(injectCode);
let ret = chrome.devtools.inspectedWindow.eval(injectCode, function (result, info) {
if (info.isException) {
debugger
if (info && info.isException) {
console.log(info.value)
}
@@ -234,6 +244,9 @@
// chrome.devtools.inspectedWindow.eval(`window.ccinspector.testMsg3()`)
let f = require("../../core/event-mgr");
console.log(f.id);
},
onMemoryTest() {
this.evalInspectorFunction("onMemoryInfo");
}
}
}