[Vuejs]-How to wrap JS library which creates elements by itself into Vue component with slot?

0👍

Seems to work this way:

const component = defineComponent({
  props: ['data', 'render'],
  render: function() {
    return this.render(this.data)
  },
})
function callback(data: any): Element {
  const elem = document.createElement('div')
  const app = createApp(component, {render: slots.default!, data})
  app.mount(elem);
  return elem
}

Leave a comment