Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
tzhh0617 committed Jan 1, 2024
1 parent 70dec72 commit b41218f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions docs/.vitepress/theme/components/MoneyCalculator/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<div>999</div>
</template>

<script setup lang="ts"></script>

<style scoped></style>
10 changes: 8 additions & 2 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ import DefaultTheme from 'vitepress/theme'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'


const components = import.meta.glob(['./components/*/index.vue',], { eager: true });

/** @type {import('vitepress').Theme} */
export default {
extends: DefaultTheme,
enhanceApp({ app }) {
// register your custom global components
// app.component('MyGlobalComponent' /* ... */)

app.use(ElementPlus)

for (let key in components) {
let [, name] = /[\/\\]([^\/\\]+)[\/\\]index\.vue/.exec(key);
app.component(name, components[key].default);
}
}
}
2 changes: 2 additions & 0 deletions docs/markdown-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This page demonstrates some of the built-in markdown extensions provided by VitePress.

<MoneyCalculator />

## Syntax Highlighting

VitePress provides Syntax Highlighting powered by [Shikiji](https://github.com/antfu/shikiji), with additional features like line-highlighting:
Expand Down

0 comments on commit b41218f

Please sign in to comment.