🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC] ## useGeolocation 设置定位 ``` import { useGeolocation } from '@vueuse/core' const { coords, locatedAt, error, resume, pause } = useGeolocation() ``` | State | Type | Description | | --- | --- | --- | | coords | [`Coordinates`](https://developer.mozilla.org/en-US/docs/Web/API/Coordinates) | information about the position retrieved like the latitude and longitude | | locatedAt | `Date` | The time of the last geolocation call | | error | `string` | An error message in case geolocation API fails. | | resume | `function` | Control function to resume updating geolocation | | pause | `function` | Control function to pause updating geolocation |