Skip to content

Commit

Permalink
perf: 分别标识 id/text 的 quickFind
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Nov 14, 2023
1 parent 75d13ef commit a660e41
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/AttrCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ const attrDesc: Record<string, string> = {
depth: `在某些应用上可能造成无限节点错误`,
id: `可快速查找`,
text: `可快速查找`,
// TODO id 和 text 的 quickFind 属性应该分别标识
};
</script>

Expand Down Expand Up @@ -83,7 +82,12 @@ const attrDesc: Record<string, string> = {
</g>
</svg>
<svg
v-else-if="JSON.parse(attrx.value) && focusNode.quickFind"
v-else-if="
(focusNode.quickFind ||
(attrx.name == 'id' && focusNode.idQf) ||
(attrx.name == 'text' && focusNode.textQf)) &&
JSON.parse(attrx.value)
"
viewBox="0 0 1024 1024"
>
<path
Expand Down
2 changes: 2 additions & 0 deletions src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export type RawNode = {
id: number;
pid: number;
quickFind?: boolean;
idQf?: boolean;
textQf?: boolean;
attr: RawAttr;

// list to tree
Expand Down

0 comments on commit a660e41

Please sign in to comment.