Skip to content

Commit 7361a98

Browse files
author
messenjer
committed
fix(docs): import BV3 with the client config
1 parent e8fcce8 commit 7361a98

File tree

5 files changed

+31
-26
lines changed

5 files changed

+31
-26
lines changed

docs/.vuepress/PluginComponentReference/client/components/component-doc.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default defineComponent({
140140
}, {})
141141
})
142142
const githubURL: ComputedRef<string> = computed(() => {
143-
const name = component.name ?? ''
143+
const name = component.name ?? component.__name ?? ''
144144
if (name.indexOf('{') !== -1) {
145145
// Example component (most likely an auto generated component)
146146
return ''
@@ -154,7 +154,7 @@ export default defineComponent({
154154
// component name kebab
155155
156156
const componentName: ComputedRef<string> = computed(() => {
157-
return hyphenate(component.name ?? '')
157+
return hyphenate(component.name ?? component.__name ?? '')
158158
})
159159
const tag: ComputedRef<string> = computed(() => {
160160
return `<${componentName.value}>`

docs/.vuepress/client.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {defineClientConfig} from '@vuepress/client'
2+
import 'bootstrap/scss/bootstrap.scss'
3+
import 'bootstrap-vue-3/dist/bootstrap-vue-3.css'
4+
import DocReference from './components/DocReference.vue'
5+
import ReferenceSection from './PluginComponentReference/client/components/reference-section'
6+
import {h} from 'vue'
7+
8+
export default defineClientConfig({
9+
async enhance({app, router, siteData}) {
10+
if (!__VUEPRESS_SSR__) {
11+
const {BootstrapVue3, BToastPlugin} = await import('../../dist/bootstrap-vue-3.es')
12+
app.use(BootstrapVue3)
13+
app.use(BToastPlugin)
14+
app.component('doc-reference', DocReference)
15+
app.component('ComponentReference', (props) => h(ReferenceSection, {}))
16+
}
17+
},
18+
setup() {},
19+
rootComponents: [],
20+
})

docs/.vuepress/clientAppEnhance.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/.vuepress/config.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {defineUserConfig, viteBundler} from 'vuepress'
2-
import {componentReference} from './PluginComponentReference'
1+
import {viteBundler} from '@vuepress/bundler-vite'
2+
import {defineUserConfig} from '@vuepress/cli'
33
import {defaultTheme} from '@vuepress/theme-default'
4-
import type {DefaultThemeOptions} from 'vuepress'
5-
const {searchPlugin} = require('@vuepress/plugin-search')
4+
import {searchPlugin} from '@vuepress/plugin-search'
5+
import {componentReference} from './PluginComponentReference'
66

7-
export default defineUserConfig<DefaultThemeOptions>({
7+
export default defineUserConfig({
88
lang: 'en-US',
99
base: '/bootstrap-vue-3/',
1010
title: 'BootstrapVue 3',
@@ -27,8 +27,7 @@ export default defineUserConfig<DefaultThemeOptions>({
2727
editLink: true,
2828
contributors: false,
2929
lastUpdated: true,
30-
darkMode: false,
31-
bundler: '@vuepress/bundler-webpack',
30+
colorMode: 'light',
3231
themePlugins: {
3332
mediumZoom: false,
3433
},

docs/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
"bootstrap": "5.x.x"
1212
},
1313
"devDependencies": {
14-
"@vuepress/plugin-search": "^2.0.0-beta.41",
14+
"@vuepress/plugin-search": "^2.0.0-beta.48",
15+
"@vuepress/plugin-register-components": "^2.0.0-beta.48",
1516
"bootstrap-vue-3": "file:../",
16-
"vuepress": "^2.0.0-beta.41"
17+
"vuepress": "^2.0.0-beta.48"
1718
}
1819
}

0 commit comments

Comments
 (0)