优化:文章元数据信息增加文章阅读数信息,需要单独提供后端api服务
This commit is contained in:
@@ -3,6 +3,7 @@ import MyLayout from "./components/MyLayout.vue"
|
||||
import ElementPlus from 'element-plus'
|
||||
import "element-plus/dist/index.css"
|
||||
import * as ElIcons from '@element-plus/icons-vue'
|
||||
import api from './api/index'
|
||||
import ArticleMetadata from './components/ArticleMetadata.vue'
|
||||
import './styles/vars.css'
|
||||
import './styles/custom.css'
|
||||
@@ -10,7 +11,7 @@ import './styles/custom.css'
|
||||
export default {
|
||||
...DefaultTheme,
|
||||
Layout: MyLayout,
|
||||
enhanceApp({ app }) {
|
||||
enhanceApp({ app, router }) {
|
||||
// 全局注册ElementPlus的所有图标
|
||||
for (const [key, elIcon] of Object.entries(ElIcons)) {
|
||||
app.component(key, elIcon)
|
||||
@@ -18,6 +19,10 @@ export default {
|
||||
// 全局注册ElementPlus
|
||||
app.use(ElementPlus)
|
||||
|
||||
// 全局挂载api接口
|
||||
if (typeof window !== 'undefined') {
|
||||
window.$api = api
|
||||
}
|
||||
app.component('ArticleMetadata', ArticleMetadata)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user