diff --git a/source/.eslintrc.js b/source/.eslintrc.js index 2beb5df..3c73a77 100644 --- a/source/.eslintrc.js +++ b/source/.eslintrc.js @@ -44,6 +44,7 @@ module.exports = { "@typescript-eslint/ban-ts-comment": "off", "no-inner-declarations": "off", "vue/no-unused-vars": "off", - "@typescript-eslint/no-namespace": "off" + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/no-this-alias": "off" } }; diff --git a/source/src/core/types.ts b/source/src/core/types.ts index c27017e..c35a9a7 100644 --- a/source/src/core/types.ts +++ b/source/src/core/types.ts @@ -17,6 +17,7 @@ export enum Msg { UpdateFrames = "UpdateFrames", // 更新页面的frame UseFrame = "UseFrame", GetObjectItemData = "GetObjectItemData", + LogData = "LogData", SetProperty = "set-property", // 设置node属性 UpdateProperty = "update-property", // 更新属性 } diff --git a/source/src/devtools/bus.ts b/source/src/devtools/bus.ts index f552e58..70f414a 100644 --- a/source/src/devtools/bus.ts +++ b/source/src/devtools/bus.ts @@ -3,6 +3,7 @@ import Vue from "vue" export enum BusMsg { ShowPlace = "ShowPlace", RequestObjectData = "RequestObjectData", + LogData = "LogData", FoldAllGroup = "FoldAllGroup" } diff --git a/source/src/devtools/data.ts b/source/src/devtools/data.ts index 7790ddc..8f3fd2d 100644 --- a/source/src/devtools/data.ts +++ b/source/src/devtools/data.ts @@ -193,11 +193,13 @@ export class Property { } export class Group { + public id: string = ""; public name: string = "group"; public data: Array = []; - constructor(name: string) { + constructor(name: string,id?:string) { this.name = name; + this.id=id||''; } addProperty(property: Property) { diff --git a/source/src/devtools/ui/index.vue b/source/src/devtools/ui/index.vue index 49dd454..baa1f12 100644 --- a/source/src/devtools/ui/index.vue +++ b/source/src/devtools/ui/index.vue @@ -147,7 +147,6 @@ export default class Index extends Vue { } - private syncSettings() { if (settings.data) { const {refreshType, refreshTime} = settings.data; @@ -204,6 +203,9 @@ export default class Index extends Vue { this.requestList.push({id: data.id, cb}); this.sendMsgToContentScript(Msg.GetObjectItemData, data) }); + Bus.$on(BusMsg.LogData, (data: string[]) => { + this.sendMsgToContentScript(Msg.LogData, data); + }) } filterNode(value: any, data: any) { diff --git a/source/src/devtools/ui/property-group.vue b/source/src/devtools/ui/property-group.vue index 3409fa7..6c939a2 100644 --- a/source/src/devtools/ui/property-group.vue +++ b/source/src/devtools/ui/property-group.vue @@ -1,11 +1,19 @@