1.0.5 • Published 6 years ago

vue-component-geolocation v1.0.5

Weekly downloads
29
License
-
Repository
-
Last release
6 years ago

vue-component-geolocation

Vue renderless component to use Geolocation API using scoped slots

notification button

Installation

import Geolocation from 'vue-component-geolocation'

Usage

This component is renderless so it doesn't impose any decisions about design or layout. You are free to use it as you wish.

Simple usage

<geolocation></geolocation>

More complex usage

<geolocation :auto="false">
  <div slot-scope="{ getCurrentPosition, currentLocation, loading, error }"><!-- slot-scope allow to use methods and properties -->
    <div>
      <div v-if="error">{{error.code}}: {{error.message}}</div>
      <div v-if="currentLocation.coords.latitude && currentLocation.coords.longitude">{{currentLocation.coords.latitude}}: {{currentLocation.coords.longitude}}</div>
      <button @click="getCurrentPosition" :disabled="loading">Geolocate me</button>
    </div>
  </div>
</geolocation>

Usage

Sources:

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago