21 lines
620 B
JavaScript
21 lines
620 B
JavaScript
// .vitepress/theme/index.js
|
|
import DefaultTheme from 'vitepress/theme'
|
|
import './custom.css'
|
|
|
|
/** @type {import('vitepress').Theme} */
|
|
export default {
|
|
extends: DefaultTheme,
|
|
enhanceApp({ app }) {
|
|
const components = import.meta.glob('./components/*.vue', { eager: true })
|
|
for (const path in components) {
|
|
mcomponents[path]().then((c) => {
|
|
console.log(path, c)
|
|
})
|
|
}
|
|
Object.entries(components).forEach(([path, definition]) => {
|
|
const componentName = path.split('/').pop().replace(/\.\w+$/, '')
|
|
console.log(componentName)
|
|
app.component(componentName, definition.default)
|
|
})
|
|
}
|
|
}
|