Bilibili-Evolved/registry/lib/components/style/hide/trending-search/index.ts
2023-03-26 14:37:50 +08:00

28 lines
746 B
TypeScript

import { defineComponentMetadata } from '@/components/define'
import { allMutations } from '@/core/observer'
export const component = defineComponentMetadata({
name: 'hideTrendingSearch',
displayName: '隐藏热搜',
tags: [componentsTags.style],
instantStyles: [
{
name: 'hideTrendingSearch',
style: () => import('./hide-trending-search.scss'),
},
],
entry: async () => {
allMutations(records => {
records.forEach(record => {
if (
record.target instanceof HTMLInputElement &&
record.target.classList.contains('nav-search-input') &&
record.target.placeholder !== '搜索'
) {
record.target.placeholder = '搜索'
}
})
})
},
})