fix: lint

This commit is contained in:
magicFeirl 2025-02-12 15:23:15 +08:00
parent 9069c3a8e6
commit d517d5860d

View File

@ -2,15 +2,13 @@ import { defineComponentMetadata } from '@/components/define'
import { allMutations } from '@/core/observer'
import { select } from '@/core/spin-query'
const DEFAULT_PLACEHOLDER = '搜索'
const resetPlaceholder = (input: HTMLInputElement) => {
input.placeholder = input.title = DEFAULT_PLACEHOLDER
input.placeholder = DEFAULT_PLACEHOLDER
input.title = DEFAULT_PLACEHOLDER
}
export const component = defineComponentMetadata({
name: 'hideTrendingSearch',
displayName: '隐藏热搜',
@ -23,11 +21,12 @@ export const component = defineComponentMetadata({
],
entry: async () => {
const input: HTMLInputElement = await select('input.nav-search-input', {
queryInterval: 500
});
queryInterval: 500,
})
if (input) {
return resetPlaceholder(input)
resetPlaceholder(input)
return
}
// Fallback to observer