Merge pull request #288 from nagisa77/codex/add-keyword-matching-for-categories-and-tags

Add categories/tags to search
This commit is contained in:
Tim
2025-07-31 12:52:39 +08:00
committed by GitHub
4 changed files with 51 additions and 5 deletions

View File

@@ -74,7 +74,9 @@ export default {
const iconMap = {
user: 'fas fa-user',
post: 'fas fa-file-alt',
comment: 'fas fa-comment'
comment: 'fas fa-comment',
category: 'fas fa-folder',
tag: 'fas fa-hashtag'
}
watch(selected, val => {
@@ -89,6 +91,10 @@ export default {
if (opt.postId) {
router.push(`/posts/${opt.postId}#comment-${opt.id}`)
}
} else if (opt.type === 'category') {
router.push({ path: '/', query: { category: opt.id } })
} else if (opt.type === 'tag') {
router.push({ path: '/', query: { tags: opt.id } })
}
selected.value = null
keyword.value = ''