diff --git a/src/components/ArticleCard/src/Article.vue b/src/components/ArticleCard/src/Article.vue
index e3aef591..ee047133 100644
--- a/src/components/ArticleCard/src/Article.vue
+++ b/src/components/ArticleCard/src/Article.vue
@@ -32,7 +32,10 @@
{{ t('settings.featured') }}
-
+
{{ post.categories[0].name }}
@@ -43,7 +46,11 @@
@@ -118,6 +125,7 @@ import { useAppStore } from '@/stores/app'
import { computed, defineComponent } from 'vue'
import { useI18n } from 'vue-i18n'
import SvgIcon from '@/components/SvgIcon/index.vue'
+import { useRouter } from 'vue-router'
export default defineComponent({
name: 'ObFeatureList',
@@ -129,6 +137,7 @@ export default defineComponent({
}
},
setup(props) {
+ const router = useRouter()
const appStore = useAppStore()
const { t } = useI18n()
@@ -137,6 +146,14 @@ export default defineComponent({
window.location.href = link
}
+ const navigateToTag = (slug: string) => {
+ router.push({ name: 'post-search', query: { tag: slug } })
+ }
+
+ const navigateToCategory = (slug: string) => {
+ router.push({ name: 'post-search', query: { category: slug } })
+ }
+
return {
avatarClasses: computed(() => ({
'hover:opacity-50 cursor-pointer': true,
@@ -146,6 +163,8 @@ export default defineComponent({
return { background: appStore.themeConfig.theme.header_gradient_css }
}),
post: computed(() => props.data),
+ navigateToTag,
+ navigateToCategory,
handleAuthorClick,
t
}
diff --git a/src/components/ArticleCard/src/HorizontalArticle.vue b/src/components/ArticleCard/src/HorizontalArticle.vue
index d35bb4e7..16e8cb2d 100644
--- a/src/components/ArticleCard/src/HorizontalArticle.vue
+++ b/src/components/ArticleCard/src/HorizontalArticle.vue
@@ -34,7 +34,10 @@
-
+
{{ post.categories[0].name }}
@@ -49,6 +52,7 @@
# {{ post.tags[index - 1].name }}
@@ -124,6 +128,7 @@ import { useAppStore } from '@/stores/app'
import { useCommonStore } from '@/stores/common'
import { useI18n } from 'vue-i18n'
import SvgIcon from '@/components/SvgIcon/index.vue'
+import { useRouter } from 'vue-router'
enum TagLimit {
forMobile = '2',
@@ -140,6 +145,7 @@ export default defineComponent({
}
},
setup(props) {
+ const router = useRouter()
const appStore = useAppStore()
const commonStore = useCommonStore()
const { t } = useI18n()
@@ -150,6 +156,14 @@ export default defineComponent({
window.location.href = link
}
+ const navigateToTag = (slug: string) => {
+ router.push({ name: 'post-search', query: { tag: slug } })
+ }
+
+ const navigateToCategory = (slug: string) => {
+ router.push({ name: 'post-search', query: { category: slug } })
+ }
+
return {
avatarClass: computed(() => ({
'hover:opacity-50 cursor-pointer': true,
@@ -166,6 +180,8 @@ export default defineComponent({
}
return tagCount > TagLimit.default ? TagLimit.default : tagCount
}),
+ navigateToTag,
+ navigateToCategory,
post,
handleAuthorClick,
t
diff --git a/src/components/Sidebar/src/CategoryBox.vue b/src/components/Sidebar/src/CategoryBox.vue
index 90ab18f6..b0142636 100644
--- a/src/components/Sidebar/src/CategoryBox.vue
+++ b/src/components/Sidebar/src/CategoryBox.vue
@@ -1,5 +1,5 @@
-