vue-strap
vue-strap copied to clipboard
A way to close a popover from parent's component
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!
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()