diff --git a/devtools/app/app.vue b/devtools/app/app.vue index 65560a05b6..a4d7010bec 100644 --- a/devtools/app/app.vue +++ b/devtools/app/app.vue @@ -70,8 +70,6 @@ function onSlotLeave(slot: string) { window.dispatchEvent(event) } -const searchTerm = ref() - const tabs = computed(() => { if (!component.value) return const themeCount = component.value.meta.slots ? Object.keys(component.value.meta.slots)?.length : 0 @@ -81,6 +79,19 @@ const tabs = computed(() => { { label: 'Theme', slot: 'theme', icon: 'i-heroicons-paint-brush', disabled: !themeCount } ] }) + +const searchOpened = ref(false) +function onComponentSearch(value: any) { + const match = components.value.find(c => c.slug === value?.slug) + searchOpened.value = false + + if (!match) return + component.value = match +} + +defineShortcuts({ + meta_k: () => searchOpened.value = true +})