2024-09-24 07:14:24 +00:00
|
|
|
// .vitepress/theme/index.js
|
|
|
|
import DefaultTheme from 'vitepress/theme'
|
|
|
|
import './custom.css'
|
|
|
|
|
2024-10-09 11:05:41 +00:00
|
|
|
/** @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)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|