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