KABBOUCHI / vue-tippy

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

How refreshContent component? #306

Open romastolbov opened 8 months ago

romastolbov commented 8 months ago

Currently, if you open a component with a text field inside useTippy, enter a value there, then close and re-open it, the field will remain filled. How can I get rid of keep-alive?

Not work:

const { refreshContent } = useTippy(triggerRef, {
  content: computed(() => {
    return h(ComponentList, {
      items: list.value,
      activeIndex: activeIndex.value, // always 0
      onHover: (value) => { activeIndex.value = value }
    })
  }),
  onHide() {
      refreshContent()
  },
 } 
andrei-nikic-co commented 3 months ago

I have the same issue, refreshContent doesn't work. I wonder, is there a way to call a method inside the rendered vue component? The one that can be exposed via defineExpose.

UPDATE: Due to some limitation on my side, I can use only the Composition API method - useTippy

KABBOUCHI commented 3 months ago

@andrei-nikic-co plz can u share a quick example here https://vue.new/? also i don't think refresh is needed?