Skip to content

Commit c8e9b20

Browse files
committed
ref: use vnode instead of a fully fledged app for rendering the component
1 parent e823364 commit c8e9b20

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.changeset/tall-owls-open.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vingy/vueltip": patch
3+
---
4+
5+
ref: vueltip no longer creates an own app to render the tooltip

packages/vueltip/src/plugin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { App, Component, createApp } from 'vue'
1+
import { App, Component, createVNode, render } from 'vue'
22
import { setOptions } from './options'
33
import type { Options } from './types'
44

@@ -15,8 +15,8 @@ export const vueltipPlugin = {
1515
container.id = '__vueltip_root__'
1616
document.body.appendChild(container)
1717

18-
const tooltipApp = createApp(component)
19-
tooltipApp._context = app._context // Share the plugin context
20-
tooltipApp.mount(container)
18+
const vnode = createVNode(component)
19+
vnode.appContext = app._context
20+
render(vnode, container)
2121
},
2222
}

0 commit comments

Comments
 (0)