feat: 使用 axios 扩展的方式实现 mock 数据
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -65,6 +65,7 @@ export default {
|
||||
this.$notify({
|
||||
title: '模拟表格数据请求完毕'
|
||||
})
|
||||
console.log(res)
|
||||
this.table = res.list
|
||||
this.page.pageTotal = res.page.total
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user