Skip to content

Commit 4a08343

Browse files
committed
fix: custom inspector bugs
1 parent 3524fad commit 4a08343

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

packages/applet/src/modules/custom-inspector/components/state/Index.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type { CustomInspectorNode, CustomInspectorOptions, CustomInspectorState } from '@vue/devtools-kit'
33
import { DevToolsMessagingEvents, onRpcConnected, rpc } from '@vue/devtools-core'
44
import { parse } from '@vue/devtools-kit'
5-
import { vTooltip, VueIcIcon } from '@vue/devtools-ui'
5+
import { vTooltip, VueIcIcon, VueInput } from '@vue/devtools-ui'
66
import { until } from '@vueuse/core'
77
import { Pane, Splitpanes } from 'splitpanes'
88
import { computed, onUnmounted, ref, watch } from 'vue'
@@ -151,7 +151,7 @@ function getInspectorTree(filter = '') {
151151
})
152152
}
153153
154-
until(inspectorId).toBeTruthy().then(getInspectorTree)
154+
until(inspectorId).toBeTruthy().then(() => getInspectorTree())
155155
156156
function onInspectorTreeUpdated(_data: string) {
157157
const data = parse(_data) as {
@@ -198,7 +198,10 @@ onUnmounted(() => {
198198
<DevToolsHeader :doc-link="customInspectState.homepage!">
199199
<Navbar />
200200
</DevToolsHeader>
201-
<template v-if="tree.length">
201+
<Empty v-if="!tree.length && !filterTreeKey.trim().length">
202+
No Data
203+
</Empty>
204+
<template v-else>
202205
<Splitpanes class="flex-1 overflow-auto">
203206
<Pane border="r base" size="40" h-full>
204207
<div class="h-full flex flex-col p2">
@@ -210,9 +213,12 @@ onUnmounted(() => {
210213
</div>
211214
</div>
212215
</div>
213-
<div class="no-scrollbar flex-1 select-none overflow-scroll">
216+
<div v-if="tree.length" class="no-scrollbar flex-1 select-none overflow-scroll">
214217
<ComponentTree v-model="selected" :data="tree" />
215218
</div>
219+
<Empty v-else>
220+
No Data
221+
</Empty>
216222
</div>
217223
</Pane>
218224
<Pane size="60">
@@ -233,8 +239,5 @@ onUnmounted(() => {
233239
</Pane>
234240
</Splitpanes>
235241
</template>
236-
<Empty v-else>
237-
No Data
238-
</Empty>
239242
</div>
240243
</template>

packages/applet/src/modules/custom-inspector/index.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ function getInspectorInfo() {
6868
logo: payload?.logo,
6969
timelineLayerIds: payload?.timelineLayers.map(item => item.id),
7070
pluginId: props.pluginId,
71+
treeFilterPlaceholder: payload.treeFilterPlaceholder,
72+
stateFilterPlaceholder: payload.stateFilterPlaceholder,
7173
}
7274
inspectorState.value = state
7375
restoreRouter()

0 commit comments

Comments
 (0)