feat: 优化接口配置设计,注册的网络请求会自动注册到 vue 原型 $api 上,修改了一些旧的接口调用方式
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user