优化:文章元数据信息开启显示文章阅读数,需要单独提供后端 HTTPS API 服务

This commit is contained in:
2022-11-27 15:44:56 +08:00
parent 9056dfbdd5
commit feea6a3531
11 changed files with 135 additions and 6 deletions

View File

@@ -2,6 +2,8 @@ import DefaultTheme from 'vitepress/theme'
import MyLayout from './MyLayout.vue'
import './styles/vars.css'
import './styles/custom.css'
import axios from 'axios'
import api from './api/index'
export default {
...DefaultTheme,
@@ -10,6 +12,12 @@ export default {
// extend default theme custom behaviour.
DefaultTheme.enhanceApp(ctx)
// 全局挂载 API 接口
ctx.app.config.globalProperties.$http = axios
if (typeof window !== 'undefined') {
window.$api = api
}
// register your custom global components
// ctx.app.component('MyGlobalComponent' /* ... */)
}