Vue.js
- 4 ответа
- 0 вопросов
3
Вклад в тег
export default { someConstant: 1, data: {...} }
let id;
const getContinuousPosition = () => {
id = navigator.geolocation.watchPosition((position) => {
const { latitude, longitude } = position.coords;
continousCoordinates.value = [
longitude,
latitude
]
}, error, options);
};
...
onUnmounted(() => {
if(id){
navigator.geolocation.clearWatch(id);
}
})