NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
[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 |