I have a component structured like this
<AgentCard :agent="agent" />
, with the object agent
containing properties such as FirstName, LastName, Recent Orders
, and more.
My current challenge involves displaying this component inside a Google Maps InfoBox. The infoWindow.setContent()
method (which is part of the Google Maps API used to showcase popup info windows) only accepts an HTML string. Therefore, I am attempting to manually render the <AgentCard>
, extract the HTML content of the rendered component, and then pass it on to the setContent()
method.
I made an attempt using
Vue.compile('<AgentCard :agent="agent" />').render()
, but unfortunately, this approach did not work. How can I go about manually rendering a Vue component and obtaining its HTML content?