vue-strap icon indicating copy to clipboard operation
vue-strap copied to clipboard

A way to close a popover from parent's component

Open joelxr opened this issue 7 years ago • 1 comments

Hello, the popover component opens and closes based on the trigger mode only (click, focus, etc). But, I'm trying to close an opened popover differently, for example, after clicking a button inside the popover's content (slot).

I can't for example:

import { popover } from 'vue-strap'
// ...
this.popover.show = false

Is there a way to close it from a parent?

Thanks in advance!

joelxr avatar Aug 12 '17 20:08 joelxr

I have had luck giving the popover a ref and using that to call the toggle() method on the popover.

In the template:

<popover ref="myPopover" ...

Then, in your component code:

this.$refs.myPopover.toggle()

claytonrcarter avatar Mar 07 '18 02:03 claytonrcarter