I'm using Vue to build an app with Esri's Mapping API.
Via the Esri API, I'm able to set a popup template content using an object:
const popupWindowTemplate = {
title: "{mag} magnitude near {place}",
content: getContent
};
and a function
getContent: function(){
let node = document.createElement('div');
node.innerHTML = "<button type='button'>Do my thing!</button>"
return node;
}
However, I would like the getTemplate function to return a Vue component rendered in the innerHTML instead of hard coded html.
I have a component:
const buffer = Vue.component('do-mything', {
template: '<div><button type="button" @click="domything">Do my thing!</button></div>',
data() {
return {
somevalue: ''
};
}
});
and suspect it has something to do with components render functions, but have been having trouble figuring out how to insert the component in the getContent function.