Akryum / floating-vue

💬 Easy tooltips, popovers, dropdown, menus... for Vue
https://floating-vue.starpad.dev/
MIT License
3.28k stars 335 forks source link

Cannot get it to work with Vue 3 #955

Closed matthewknill closed 1 year ago

matthewknill commented 1 year ago

I installed the package using the following:

npm i -S floating-vue@2.0.0-beta.20

I then created the following component:

<template>
    <VTooltip>
        <button>TEST</button>
        <template #popper>
            TEST TOOLTIP
        </template>
    </VTooltip>
</template>
<script setup>
import { VTooltip } from "floating-vue"
</script>

When I attempt to use this component, I get the following error: image

As per the doco, I also attempted to add use(FloatingVue) after importing with import FloatingVue from 'floating-vue' in my main.ts file but it produced the same error.

or2e commented 1 year ago

@matthewknill Try to reproduce here https://stackblitz.com/

Joshw8 commented 1 year ago

You are importing the directive and using the component approach.

import {Tooltip as VTooltip } from "floating-vue"

matthewknill commented 1 year ago

Cheers @Joshw8

Attempted to use use(FloatingVue) and it seems to work now.