feat: 优化接口配置设计,注册的网络请求会自动注册到 vue 原型 $api 上,修改了一些旧的接口调用方式

This commit is contained in:
FairyEver
2020-05-07 15:49:28 +08:00
parent 804f66eb05
commit 28acfdbb04
21 changed files with 118 additions and 103 deletions

View File

@@ -10,8 +10,6 @@ export default `<template>
</template>
<script>
import { businessTable1List } from '@api/demo.business.table.1'
export default {
data () {
return {
@@ -57,7 +55,7 @@ export default {
},
fetchData () {
this.loading = true
businessTable1List({
this.$api.DEMO_BUSINESS_TABLE_1_LIST({
...this.pagination
}).then(res => {
this.data = res.list

View File

@@ -24,7 +24,6 @@
import '../install'
import doc from './doc.md'
import code from './code.js'
import { businessTable1List } from '@api/demo.business.table.1'
export default {
data () {
@@ -73,7 +72,7 @@ export default {
},
fetchData () {
this.loading = true
businessTable1List({
this.$api.DEMO_BUSINESS_TABLE_1_LIST({
...this.pagination
}).then(res => {
this.data = res.list