2.0.0 • Published 3 years ago
vx-geolocation v2.0.0
vx-geolocation
Tracks user's location via reactive variables :world_map:
Install
npm install vx-geolocationUsage
Using this tiny package is fairly simple:
import { useGeolocation } from "vx-geolocation";
...
// then you can call the hook
const { position, error } = useGeolocation();Documentation
Under the hood a Browser API is used to get the location data (See: MDN docs for more info).
The hook returns two reactive variables: positions and error.
There is a small App.vue file so you can play with it easily locally.
Project Setup
npm installCompile and Hot-Reload for Development
npm run devType-Check, Compile and Minify for Production
npm run buildLint with ESLint
npm run lint