nixin-web/.vitepress/theme/index.js
2024-10-09 14:05:43 +03:00

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)
})
}
}