更新tree组件的相关功能

This commit is contained in:
xu_yanfeng
2024-12-12 20:13:50 +08:00
parent 085e1528f0
commit 625b6d6ee9
5 changed files with 62 additions and 85 deletions

View File

@@ -107,6 +107,7 @@ export class TestServer {
.buildProperty("un_known", new EngineData().init('name', 'un_known', 'uuid'))
const c = this.testData.buildChild("str1")
c.active = false;
c.buildComponent("group51").buildProperty("str1", new StringData("str1"))
c.buildComponent("group52").buildProperty("num", new NumberData(200))

View File

@@ -4,6 +4,7 @@
<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>
</CCSection>
</div>
</template>
@@ -13,8 +14,8 @@ import { ITreeData } from "@xuyanfeng/cc-ui/types/cc-tree/const";
import { defineComponent, ref } from "vue";
import { Msg, Page, PluginEvent } from "../../../core/types";
import { connectBackground } from "../connectBackground";
import { TreeData } from "../data";
import { TestServer } from "./server";
import { FrameDetails, TreeData } from "../data";
import { testServer, TestServer } from "./server";
const { CCButton, CCSection } = ccui.components;
export default defineComponent({
name: "test",
@@ -43,6 +44,14 @@ export default defineComponent({
const event = new PluginEvent(Page.Inject, Page.Devtools, Msg.TreeInfo, data);
connectBackground.doCallback(event);
},
onFrames() {
const data: FrameDetails[] = [
{ url: "url1", frameID: 1 },
{ url: "url2", frameID: 2 },
];
const event = new PluginEvent(Page.Background, Page.Devtools, Msg.UpdateFrames, data);
testServer.send(event);
},
};
},
});