UNPKG

@vuepress-reco/style-default

Version:
17 lines (16 loc) 872 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const vue_1 = require("vue"); const client_1 = require("@vuepress/client"); const composables_1 = require("./composables"); const client_2 = require("@vuepress/plugin-theme-data/lib/client"); exports.default = client_1.defineClientAppSetup(() => { // we need to access sidebar items in multiple components // so we make it global computed const themeLocale = client_2.useThemeLocaleData(); const frontmatter = client_1.usePageFrontmatter(); const sidebarItems = vue_1.computed(() => composables_1.resolveSidebarItems(frontmatter.value, themeLocale.value)); vue_1.provide(composables_1.sidebarItemsSymbol, sidebarItems); const pageHeaders = vue_1.computed(() => composables_1.resolvePageHeaders()); vue_1.provide(composables_1.pageHeadersSymbol, pageHeaders); });