0.0.1 • Published 12 months ago

getlocation-now v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

get-location

Install

pnpm add get-location

Usage

import getLocation from 'get-location'

getLocation.then(res => {
  console.warn('首页获取位置成功', res)
  this.latitude = res.lat
  this.longitude = res.lng
  // 这里根据获取到的经纬度请求后台接口...
})
.catch(err => {
  console.error('首页获取位置失败', err)
  // 错误处理
})