0

I'm trying to use Vue Devtools to debug my App and I was wondering how to retrieve the info I see after an event.

   <l-marker v-for="marker in markers" 
     :lat-lng="marker.position"
     :key="marker.id" 
     :draggable=true 
     @dragend="dragend">
  </l-marker>

My event is @dragend="dragend",How can I get the lat and lng values?

enter image description here

Edit: Is this correct?

 dragend: function(event){

            console.log(event.target._latlng);
 }
Community
  • 1
  • 1
Uncoke
  • 1,832
  • 4
  • 26
  • 58
  • 1
    if you edit your attribute in`:lat-lng.sync="marker.position"` you will have the position always updated within the property `marker.position`, without using `@dragend` – Fab Jun 03 '19 at 15:53
  • Thanks a lot @fabruex! .sync is very helpful! I'll use it to update render and @dragend to call a method and apply search in bg. very helpful! Thanks a lot for your time. – Uncoke Jun 03 '19 at 16:08
  • I'm glad it helped you. I added it as answer – Fab Jun 03 '19 at 16:16
  • Allora grazie ;) – Uncoke Jun 03 '19 at 16:38

1 Answers1

1

if you edit your attribute in

:lat-lng.sync="marker.position" 

you will have the position always updated within the property marker.position, without using @dragend event

Fab
  • 4,526
  • 2
  • 21
  • 45