How can I use Vue's render() function with Quasar components? #17792
-
I am trying to use Vue's render function to create a piece of DOM for a Quasar component. So I try const elem = document.createElement('div') Unfortunatelly this will create an error indicating the the quasar component somehow is undefined When I try this with my own Component that does NOT use Quasar components it works fine. We I use quasar components inside my component I get the same error as above. I should be noted that I tried this with QCard, QItem, QBtn, and QBadge. Interestingly enough, it worked for QBadge, but not for the others. Maybe someone can try to explain what's going on, and maybe even suggest how to accomplish my task. If anyone is wondering why on earth I try to use render() with quasar component, I am trying to hook into a third party graph component that provides a means to display your own tooltips. The means consists in providing the DOM element that represents the tooltip. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Suggests that |
Beta Was this translation helpful? Give feedback.
If you mean
import { render } from 'vue'
, then it won't work if you are using any plugin, e.g. Quasar, vue-i18n, vue-router, Pinia, etc. Sinceevt.toolTip
is an existing DOM element, you can useconst tooltipApp = createApp(GraphTooltip)
, copy things from your originalapp
instance, then dotooltipApp.mount(toolTip)
.For copying stuff from the main to the child app, you can take this as an example:
quasar/ui/src/install-quasar.js
Lines 30 to 39 in c43dc46