@vingy/vueltip 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +14 -7
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as __reExport, t as __exportAll } from "./chunk-CtajNgzt.mjs";
2
2
  import * as Vue from "vue";
3
- import { computed, createApp, defineComponent, h, ref, useTemplateRef, watch } from "vue";
3
+ import { computed, createVNode, defineComponent, h, ref, render, useTemplateRef, watch } from "vue";
4
4
 
5
5
  //#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
6
6
  const min = Math.min;
@@ -1651,16 +1651,23 @@ const vueltipDirective = {
1651
1651
 
1652
1652
  //#endregion
1653
1653
  //#region src/plugin.ts
1654
+ const CONTAINER_ID = "__vueltip_root__";
1655
+ const getContainer = () => {
1656
+ const existing = document.getElementById(CONTAINER_ID);
1657
+ if (existing) return existing;
1658
+ const container = document.createElement("div");
1659
+ container.id = CONTAINER_ID;
1660
+ document.body.appendChild(container);
1661
+ return container;
1662
+ };
1654
1663
  const vueltipPlugin = { install: (app, options) => {
1655
1664
  const { component, ...rest } = options;
1656
1665
  setOptions(rest);
1657
1666
  if (!component) return;
1658
- const container = document.createElement("div");
1659
- container.id = "__vueltip_root__";
1660
- document.body.appendChild(container);
1661
- const tooltipApp = createApp(component);
1662
- tooltipApp._context = app._context;
1663
- tooltipApp.mount(container);
1667
+ const container = getContainer();
1668
+ const vnode = createVNode(component);
1669
+ vnode.appContext = app._context;
1670
+ render(vnode, container);
1664
1671
  } };
1665
1672
 
1666
1673
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vingy/vueltip",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Headless tooltip which only shows when necessary.",
5
5
  "keywords": [
6
6
  "composition-api",