Skip to content

Commit

Permalink
#15
Browse files Browse the repository at this point in the history
TCOTC committed Apr 18, 2024
1 parent 2ccd896 commit 02cd160
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -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();

0 comments on commit 02cd160

Please sign in to comment.