mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-06-04 23:34:01 +00:00
修复自动刷新的bug
This commit is contained in:
parent
fa8a3ab251
commit
8c0fe7e2bc
@ -16,6 +16,14 @@
|
|||||||
background-color: #6d6d6d;
|
background-color: #6d6d6d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-tree-node__content {
|
||||||
|
.leaf {
|
||||||
|
span {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.el-input {
|
.el-input {
|
||||||
input {
|
input {
|
||||||
text-align: left !important;
|
text-align: left !important;
|
||||||
|
@ -248,7 +248,7 @@ export default class Index extends Vue {
|
|||||||
treeData = [treeData]
|
treeData = [treeData]
|
||||||
}
|
}
|
||||||
this.treeData = treeData;
|
this.treeData = treeData;
|
||||||
if (this.selectedUUID) {
|
if (this._checkSelectedUUID()) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
this.$refs.tree.setCurrentKey(this.selectedUUID);
|
this.$refs.tree.setCurrentKey(this.selectedUUID);
|
||||||
@ -257,6 +257,36 @@ export default class Index extends Vue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_checkSelectedUUID() {
|
||||||
|
if (this.selectedUUID) {
|
||||||
|
const b = this._findUuidInTree(this.treeData, this.selectedUUID)
|
||||||
|
if (b) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.selectedUUID = null;
|
||||||
|
this.treeItemData = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
_findUuidInTree(data: TreeData[], targetUUID: string) {
|
||||||
|
|
||||||
|
function circle(tree: TreeData[]) {
|
||||||
|
for (let i = 0; i < tree.length; i++) {
|
||||||
|
let item: TreeData = tree[i];
|
||||||
|
if (item.uuid === targetUUID) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (circle(item.children)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return circle(data)
|
||||||
|
}
|
||||||
|
|
||||||
_onMsgNodeInfo(eventData: NodeInfoData) {
|
_onMsgNodeInfo(eventData: NodeInfoData) {
|
||||||
this.isShowDebug = true;
|
this.isShowDebug = true;
|
||||||
this.treeItemData = eventData;
|
this.treeItemData = eventData;
|
||||||
@ -391,9 +421,6 @@ export default class Index extends Vue {
|
|||||||
this._clearTimer();
|
this._clearTimer();
|
||||||
this.timerID = setInterval(() => {
|
this.timerID = setInterval(() => {
|
||||||
this.onBtnClickUpdateTree();
|
this.onBtnClickUpdateTree();
|
||||||
if (this.selectedUUID) {
|
|
||||||
this.sendMsgToContentScript(Msg.NodeInfo, this.selectedUUID);
|
|
||||||
}
|
|
||||||
}, time);
|
}, time);
|
||||||
} else {
|
} else {
|
||||||
this._clearTimer();
|
this._clearTimer();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user