From 02cd160e1e3e4e22d762e3424a1e916c87d02cf1 Mon Sep 17 00:00:00 2001 From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com> Date: Thu, 18 Apr 2024 21:40:23 +0800 Subject: [PATCH] #15 --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 39b0ac8..60d3107 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,9 +9,9 @@ const CLASS_NAME = "highlight-search-result" const SearchComponent = { setup() { onMounted(() => { - const rootElement = document.querySelector(`.${CLASS_NAME}`); + const rootElement = document.querySelector(`.layout__center [data-type="wnd"].layout__wnd--active > .layout-tab-container`); if (rootElement) { - const inputElement = rootElement.querySelector('.search-dialog .b3-text-field'); + const inputElement = rootElement.querySelector(`.${CLASS_NAME} .search-dialog .b3-text-field`); if (inputElement) { setTimeout(() => { // 等待一小段时间确保元素加载完全 inputElement.focus();