mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-11-27 07:28:46 +00:00
修复发送纯数据导致的异常问题
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<div v-if="show" class="test">
|
||||
<CCSection name="功能测试" :expand="false">
|
||||
<CCSection name="功能测试" :expand="true">
|
||||
<CCButton @click="onClickHasCocosGame">Has CocosGame</CCButton>
|
||||
<CCButton @click="onClickNoCocosGame">No CocosGame</CCButton>
|
||||
<CCButton @click="onTestTree">init tree data</CCButton>
|
||||
<CCButton @click="onFrames">test frame</CCButton>
|
||||
<CCButton @click="onTestNodeInfo">test node info</CCButton>
|
||||
</CCSection>
|
||||
</div>
|
||||
</template>
|
||||
@@ -26,6 +27,32 @@ export default defineComponent({
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
const show = ref(__DEV__);
|
||||
// 测试发送的是纯数据
|
||||
const testData = {
|
||||
uuid: "d1NHXHs35F1rbFJZKeigkl",
|
||||
group: [
|
||||
{
|
||||
id: "d1NHXHs35F1rbFJZKeigkl",
|
||||
name: "cc.Scene",
|
||||
data: [
|
||||
{
|
||||
name: "position",
|
||||
value: {
|
||||
id: "b9068b6f-8c1c-4d88-ac52-52cc09b37c1c",
|
||||
type: "Vec3",
|
||||
readonly: false,
|
||||
path: [],
|
||||
data: [
|
||||
{ name: "x", value: { id: "be42ab63-d767-466e-8ba4-fb1b21201c54", type: "Number", readonly: false, path: ["d1NHXHs35F1rbFJZKeigkl", "x"], data: 0 } },
|
||||
{ name: "y", value: { id: "498db9b2-e4a5-4c91-a546-1c3233e9bb50", type: "Number", readonly: false, path: ["d1NHXHs35F1rbFJZKeigkl", "y"], data: 0 } },
|
||||
{ name: "z", value: { id: "400e184f-d754-4b66-aeb9-9f1feb1136a3", type: "Number", readonly: false, path: ["d1NHXHs35F1rbFJZKeigkl", "z"], data: 0 } },
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
return {
|
||||
show,
|
||||
onClickHasCocosGame() {
|
||||
@@ -52,6 +79,10 @@ export default defineComponent({
|
||||
const event = new PluginEvent(Page.Background, Page.Devtools, Msg.UpdateFrames, data);
|
||||
testServer.send(event);
|
||||
},
|
||||
onTestNodeInfo() {
|
||||
const event = new PluginEvent(Page.Background, Page.Devtools, Msg.NodeInfo, testData);
|
||||
testServer.send(event);
|
||||
},
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user