How can I integrate a Vue component in a leaflet popup? [duplicate] How can I integrate a Vue component in a leaflet popup? [duplicate] vue.js vue.js

How can I integrate a Vue component in a leaflet popup? [duplicate]


I advise you to use vue2-leaflet instead.

It has a popup component that behaves the way you describe. See here.

enter image description here

There is also another solution, if you don't want to use a package to do the link between vue and leaflet. It's almost a trick.

You create your elaborate content in a component, but you hide it :

<my-elaborate-popup-content v-show=False ref='foo'><my-elaborate-popup-content>

Then you can access the generated html of that component in your code like this :

const template = this.$refs.foo.$el.innerHTML

and use it to fill your popup !