vue-popper
vue-popper copied to clipboard
allow to refresh the component
For my current project, I'm updating some of the options dynamically, specifically the placement, but once I change the placement it's not being applied, so I think to add some method to re-render the component will be great.
Currently, my workaround is to add a key in the component and update that key to force the component to reload, but this is more like a patch, some kind of native method will be great.
<popper
ref="popper"
:key="rerenderKey"
...
/>
method () {
refreshComponent() {
this.rerenderKey++;
}
Does the updatePopper works?
https://github.com/RobinCK/vue-popper/blob/master/src/component/popper.js.vue#L358
I also noticed in your project that you are using click while it should be clickToToggle this way you can get rid of:
if (this.closeOnDropdownClick && this.$refs.popper) {
this.$refs.popper.doClose();
}