A
A
Aizharik2019-03-26 12:33:54
leaflet
Aizharik, 2019-03-26 12:33:54

How to put VUE JS component in 2gis map popup?

I use VUE to create and update markers on a 2gis map, I add a popup to the marker through marker.bindPopup(popupContent);
how can I put a VUE component there?

// Если положить туда компонент то он не выводится
marker.bindPopup('<component>');
// а таким способом не биндятся переменные
marker.bindPopup('<component :board="item">');

Answer the question

In order to leave comments, you need to log in

2 answer(s)
0
0xD34F, 2019-03-26
@aizhar777

Initialize vue on the popupopen event :

marker.on('popupopen', function(e) {
  new Vue({ el: e.popup._contentNode });
});

A
Alexander Aksentiev, 2019-03-26
@Sanasol

no way, the cards in the frame with their scripts work and they don’t know about vue at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question