no message
Former-commit-id: 4de5051883f4b237c5dba9c4f13f9d06c9eef8a9 Former-commit-id: e53f5cd15a72cc0fed4708a49f276bdc7fbe8a1b Former-commit-id: f447a4540e449c2112681c938e9676f615efcb53
This commit is contained in:
@@ -49,15 +49,23 @@ export default {
|
|||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getData () {
|
// 请求数据
|
||||||
this.table.data = Mock.mock({
|
async getData () {
|
||||||
'list|4-10': [{
|
this.table.data = await this.dataMaker()
|
||||||
'id|+1': 1,
|
},
|
||||||
'name': '@CNAME',
|
// 生成数据 模拟 Ajax
|
||||||
'address1': '@CITY',
|
// 没有必要写在全局 mock 设置中,就在这里这样写了,这样删文件的时候也好处理
|
||||||
'address2': '@CITY'
|
dataMaker () {
|
||||||
}]
|
return new Promise((resolve, reject) => {
|
||||||
}).list
|
resolve(Mock.mock({
|
||||||
|
'list|4-10': [{
|
||||||
|
'id|+1': 1,
|
||||||
|
'name': '@CNAME',
|
||||||
|
'address1': '@CITY',
|
||||||
|
'address2': '@CITY'
|
||||||
|
}]
|
||||||
|
}).list)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user