Skip to content

Commit

Permalink
added stop and start controls for geolocation watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
egstartsev committed Oct 28, 2022
1 parent a849634 commit 39b1f00
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/core/useGeolocation/demo.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<script setup lang="ts">
import { useGeolocation } from '@vueuse/core'
const { coords, locatedAt, error } = useGeolocation()
const { coords, locatedAt, error, stop, start } = useGeolocation()
</script>

<template>
<pre lang="json">{{
<div>
<pre lang="json">{{
JSON.stringify(
{
coords: {
Expand All @@ -24,4 +25,11 @@ const { coords, locatedAt, error } = useGeolocation()
2,
)
}}</pre>
<button @click="stop">
Stop watch
</button>
<button @click="start">
Start watch
</button>
</div>
</template>

0 comments on commit 39b1f00

Please sign in to comment.