feat: 优化接口配置设计,注册的网络请求会自动注册到 vue 原型 $api 上,修改了一些旧的接口调用方式
This commit is contained in:
@@ -12,7 +12,6 @@ import marked from 'marked'
|
||||
import highlight from 'highlight.js'
|
||||
import bandupan from './plugin/baidupan'
|
||||
import 'github-markdown-css'
|
||||
import { componentsMarkdownBase } from '@api/components.markdown'
|
||||
export default {
|
||||
name: 'd2-markdown',
|
||||
props: {
|
||||
@@ -64,7 +63,7 @@ export default {
|
||||
},
|
||||
// 从 url 加载原始数据
|
||||
async getReadme (url) {
|
||||
const data = await componentsMarkdownBase(url)
|
||||
const data = await this.$api.COMPONENT_MARKDOWN_GET({ url })
|
||||
return this.marked(data)
|
||||
},
|
||||
marked (data) {
|
||||
|
||||
Reference in New Issue
Block a user