Compare commits

..

1 Commits

Author SHA1 Message Date
Tim 8c554465f6 refactor: replace font awesome with iconpark in search dropdown 2025-09-06 11:48:22 +08:00
2 changed files with 7 additions and 11 deletions
@@ -7,11 +7,6 @@
@click="item.iconClick && item.iconClick()" @click="item.iconClick && item.iconClick()"
> >
<BaseImage v-if="item.src" :src="item.src" class="timeline-img" alt="timeline item" /> <BaseImage v-if="item.src" :src="item.src" class="timeline-img" alt="timeline item" />
<component
v-else-if="item.icon && (typeof item.icon !== 'string' || !item.icon.includes(' '))"
:is="item.icon"
:size="20"
/>
<i v-else-if="item.icon" :class="item.icon"></i> <i v-else-if="item.icon" :class="item.icon"></i>
<BaseImage v-else-if="item.emoji" :src="item.emoji" class="timeline-emoji" alt="emoji" /> <BaseImage v-else-if="item.emoji" :src="item.emoji" class="timeline-emoji" alt="emoji" />
</div> </div>
+7 -6
View File
@@ -24,7 +24,7 @@
</template> </template>
<template #option="{ option }"> <template #option="{ option }">
<div class="search-option-item"> <div class="search-option-item">
<i :class="['result-icon', iconMap[option.type]]"></i> <component :is="iconMap[option.type]" class="result-icon" />
<div class="result-body"> <div class="result-body">
<div class="result-main" v-html="highlight(option.text)"></div> <div class="result-main" v-html="highlight(option.text)"></div>
<div v-if="option.subText" class="result-sub" v-html="highlight(option.subText)"></div> <div v-if="option.subText" class="result-sub" v-html="highlight(option.subText)"></div>
@@ -83,11 +83,12 @@ const highlight = (text) => {
} }
const iconMap = { const iconMap = {
user: 'fas fa-user', user: 'UserIcon',
post: 'fas fa-file-alt', post: 'FileText',
comment: 'fas fa-comment', post_title: 'FileText',
category: 'fas fa-folder', comment: 'CommentIcon',
tag: 'fas fa-hashtag', category: 'Inbox',
tag: 'TagOne',
} }
watch(selected, (val) => { watch(selected, (val) => {