getlocation-now
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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)
  // 错误处理
})

Package Sidebar

Install

npm i getlocation-now

Weekly Downloads

2

Version

0.0.1

License

ISC

Unpacked Size

19.3 kB

Total Files

26

Last publish

Collaborators

  • cellerchan