From d1abfb443030a318c44b2a3064885988731a9b2b Mon Sep 17 00:00:00 2001 From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com> Date: Thu, 18 Apr 2024 21:22:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A6=81=E5=9C=A8=E5=BD=93=E5=89=8D=E8=81=9A?= =?UTF-8?q?=E7=84=A6=E7=9A=84=E9=A1=B5=E7=AD=BE=E4=B8=AD=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=85=83=E7=B4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 0087047..dfbc5ba 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,7 +11,7 @@ const SearchComponent = { onMounted(() => { const rootElement = document.querySelector(`.${CLASS_NAME}`); if (rootElement) { - const inputElement = rootElement.querySelector('.layout__center [data-type='wnd'].layout__wnd--active > .layout-tab-container .search-dialog .b3-text-field');// 要在当前聚焦的页签中搜索元素 + const inputElement = rootElement.querySelector('.layout__center [data-type=\'wnd\'].layout__wnd--active > .layout-tab-container .search-dialog .b3-text-field');// 要在当前聚焦的页签中搜索元素 if (inputElement) { setTimeout(() => { // 等待一小段时间确保元素加载完全 inputElement.focus(); @@ -82,7 +82,7 @@ export default class PluginHighlight extends Plugin { // 如果存在具有 CLASS_NAME 类名的元素,则执行以下操作 const rootElement = existingElement; // 将已存在的元素作为根元素 // 查找具有 CLASS_NAME 类名的根元素 - const inputElement = rootElement.querySelector('.layout__center [data-type='wnd'].layout__wnd--active > .layout-tab-container .search-dialog .b3-text-field');// 要在当前聚焦的页签中搜索元素 + const inputElement = rootElement.querySelector('.layout__center [data-type=\'wnd\'].layout__wnd--active > .layout-tab-container .search-dialog .b3-text-field');// 要在当前聚焦的页签中搜索元素 if (inputElement) { // 等待一小段时间确保元素加载完全,然后聚焦到输入框并选中其中的文本 setTimeout(() => {