赞
踩
npm install --save vue-amap
// 引入地图
import aMap from 'vue-amap'
Vue.use(aMap)
aMap.initAMapApiLoader({
key: '高德地图中申请的key',
plugin: ['AMap.Geolocation', 'AMap.Geocoder']
})
在高德地图开发者中申请(https://lbs.amap.com/dev/key/app#)
3. index.vue中
<el-row> <el-col :span="6"> <el-form-item> 详细地址: <el-input v-model="address" name="address"/> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="4"> <el-form-item> </el-form-item> </el-col> <el-col :span="6"> <el-form-item> 经度: <el-input v-model="lat" name="lat" type="number"/> </el-form-item> </el-col>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。