feat: 添加mock,完成高德地图组件

This commit is contained in:
张益铭
2021-03-29 16:38:52 +08:00
parent 3c8e0c5277
commit 7545003e57
12 changed files with 668 additions and 57 deletions

28
mock/map.ts Normal file
View File

@@ -0,0 +1,28 @@
import { MockMethod } from 'vite-plugin-mock'
// http://mockjs.com/examples.html#Object
const mapList = (): any => {
const result: any[] = []
for (let index = 0; index < 200; index++) {
result.push({
plateNumber: "豫A@natural(11111, 99999)@character('upper')",
driver: '@cname()',
"lng|113-114.1-10": 1,
"lat|34-35.1-10": 1
})
}
return result
}
export default [
{
url: '/getMapInfo',
method: 'get',
response: () => {
return {
code: 0,
info: mapList()
}
},
}
] as MockMethod[]