I am using https://fullcalendar.io/ in my Vue app.
In fullcalendar I use eventRender to manipulate the display of calendar entries.
eventRender: function(event, element) {
let eventDetails = "<div style='background-color:black'>"+event.title+"</div>";
element.find(".fc-title").html(eventDetails);
}
Instead of creating a string template as above, I would like to use a Vue-component as a template and pass event-data to it and get an HTML-string back for the calendar entries shown in fullcalendar.
I am trying to figure out how to do it, but cannot figure out how to load the component, pass the data and get an HTML-string back.
I have setup a codesandbox and hope somebody can help me out. In the "components"-folder you will find Calendar.vue (fullcalendar) and EventDetails.vue (the component to be used as a template).
You can use this.$el.outerHTML. You can also use this.$refs.child.$el.outerHTML to get the HTML of a child.- Chase DeAnda