BlogInfoList.js 1.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
import { getDefaultLocale } from "@mr-hope/vuepress-shared";
import ArticleIcon from "@theme/icons/ArticleIcon.vue";
import CategoryIcon from "@mr-hope/vuepress-plugin-comment/lib/client/icons/CategoryIcon.vue";
import TagIcon from "@mr-hope/vuepress-plugin-comment/lib/client/icons/TagIcon.vue";
import TimeIcon from "@mr-hope/vuepress-plugin-comment/lib/client/icons/TimeIcon.vue";
import ArticleList from "@theme/components/Blog/ArticleList.vue";
import CategoryList from "@theme/components/Blog/CategoryList.vue";
import MyTransition from "@theme/components/MyTransition.vue";
import TagList from "@theme/components/Blog/TagList.vue";
import Timeline from "@theme/components/Blog/Timeline.vue";
import TimelineList from "@theme/components/Blog/TimelineList.vue";
import { filterArticle } from "@theme/utils/article";
import { starMixin } from "@theme/mixins/star";
export default starMixin.extend({
    name: "BlogInfo",
    components: {
        ArticleIcon,
        ArticleList,
        CategoryIcon,
        CategoryList,
        MyTransition,
        TagIcon,
        TagList,
        TimeIcon,
        Timeline,
        TimelineList,
    },
    data: () => ({
        active: "category",
    }),
    computed: {
        i18n() {
            return this.$themeLocaleConfig.blog || getDefaultLocale().blog;
        },
        articleNumber() {
            return filterArticle(this.$site.pages).length;
        },
    },
    methods: {
        setActive(name) {
            this.active = name;
        },
        navigate(path) {
            if (this.$route.path !== path)
                void this.$router.push(path);
        },
    },
});
//# sourceMappingURL=BlogInfoList.js.map