Tracks user's location via reactive variables 🗺️
npm install vx-geolocation
Using this tiny package is fairly simple:
import { useGeolocation } from "vx-geolocation";
...
// then you can call the hook
const { position, error } = useGeolocation();
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.
npm install
npm run dev
npm run build
Lint with ESLint
npm run lint