0.0.1 • Published 3 years ago
getlocation-now v0.0.1
get-location
Install
pnpm add get-locationUsage
import getLocation from 'get-location'
getLocation.then(res => {
console.warn('首页获取位置成功', res)
this.latitude = res.lat
this.longitude = res.lng
// 这里根据获取到的经纬度请求后台接口...
})
.catch(err => {
console.error('首页获取位置失败', err)
// 错误处理
})0.0.1
3 years ago