vuepress-cqy
Version:
This is an anime blog theme based on vuepress, the theme is simple, colorful, versatile, and supports customization, providing multiple components to set the theme 这是一个基于vuepress的动漫类型主题,简洁,界面漂亮,多色彩,多自定义,多功能,海报分享,相册等等,满足你搭建博客的一切需要
12 lines (11 loc) • 609 B
JavaScript
import { computed, provide } from 'vue';
import { defineClientAppSetup, usePageFrontmatter } from '@vuepress/client';
import { resolveSidebarItems, sidebarItemsSymbol, useThemeLocaleData, } from './composables';
export default defineClientAppSetup(() => {
// we need to access sidebar items in multiple components
// so we make it global computed
const themeLocale = useThemeLocaleData();
const frontmatter = usePageFrontmatter();
const sidebarItems = computed(() => resolveSidebarItems(frontmatter.value, themeLocale.value));
provide(sidebarItemsSymbol, sidebarItems);
});