KABBOUCHI / vue-tippy

VueJS Tooltip powered by Tippy.js
https://vue-tippy.netlify.app
MIT License
722 stars 86 forks source link

Not working in Vue version 3 WebComponent. #277

Closed DivakarSS closed 1 year ago

DivakarSS commented 1 year ago

I'm submitting a ... (check one with "x")

[x] bug report => see 'Providing a Reproducible Scenario'
[] feature request => do not use Github for feature requests, see 'Customers of AG Grid'
[] support request => see 'Requesting Community Support'

Expected behavior This should work after convert it into WebComponents as how it is worked in local environment.

Please tell us about your environment: O.S: Windows 10 IDE: VS Code Package Manager: npm

KABBOUCHI commented 1 year ago

u are creating an app and never mounting it

image

you can import directive and component directly

<script setup>
import { directive as VTippy, Tippy } from 'vue-tippy'
</script>

<template>
<button v-tippy="'Hello!'">
  Tippy!
</button>

<tippy content="Hi!">
  <button>Tippy!</button>
</tippy>
</template>
DivakarSS commented 1 year ago

import {directive as VTippy} from 'vue-tippy' const app = createApp({}); app.use(VTippy); app.mount('#app'); I used like this, but still in WebComponent it is not working. You can run the demo.html file in dist folder, that is the WebComponent file. I am using "build-installed-base": "vue-cli-service build --mode production --modern --target lib --inline-vue --name tippy-tooltip ./src/index.ts" command in package.json to convert the component to WebComponent.

DivakarSS commented 1 year ago

import { directive } from 'vue-tippy'export default{ directives: { tippy: directive, } } I Imported and registered like this. Now it is working in WebComponents. Thank You.