feat: 使用 axios 扩展的方式实现 mock 数据

This commit is contained in:
FairyEver
2020-05-07 23:02:12 +08:00
parent 28acfdbb04
commit ac9b1ea26d
14 changed files with 161 additions and 41 deletions

View File

@@ -52,7 +52,7 @@ export default {
// 请求表格数据
async getTableData () {
try {
const res = this.$api.DEMO_BUSINESS_ISSUE_142_LIST()
const res = await this.$api.DEMO_BUSINESS_ISSUE_142_LIST()
this.crud.data = res.list
} catch (error) {
console.log(error)

View File

@@ -27,7 +27,7 @@ export default {
this.resetFormData()
// 请求数据
try {
const res = await this.$api.DEMO_BUSINESS_ISSUE_142_DETAIL({ id })
const res = await this.$api.DEMO_BUSINESS_ISSUE_142_DETAIL(id)
const { name, address } = res
this.form = { name, address }
this.$message.success('getFormData')

View File

@@ -65,6 +65,7 @@ export default {
this.$notify({
title: '模拟表格数据请求完毕'
})
console.log(res)
this.table = res.list
this.page.pageTotal = res.page.total
})