0๐
- Define a
data
element for your coordinates in your component, see here for an example:data() {return { markerCoordinates: undefined } }
- In your
getLocation
function, you need a closure that points to the enclosing Vue instance , like thislet vm = this
. See here, e.g. - In the callback, use this variable to access the data element:
vm.markerCoordinates = [{"latitude" :latitude , "longitude" : longitude}]
- Access the it in the template simply by using
markerCoordinates
and in other methods of your component withthis.markerCoordinates
- [Vuejs]-Unknown custom element: <preview-component> ovide the "name" option
- [Vuejs]-Laravel vue pagination return invalid prop type check failed for prop
Source:stackexchange.com