Skip to content

Commit

Permalink
Merge pull request #718 from kuromoka/tooltip-options-reactive
Browse files Browse the repository at this point in the history
Fix LTooltip options to reactive
  • Loading branch information
KoRiGaN authored Jul 10, 2024
2 parents e333b7f + 50c7760 commit 2fd50c3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/components/LTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ import { tooltip, DomEvent } from 'leaflet';
export default {
name: 'LTooltip',
mixins: [Popper, Options],
props: {
options: {
type: Object,
custom: true,
default: () => ({}),
},
},
mounted() {
const options = optionsMerger(this.popperOptions, this);
this.mapObject = tooltip(options);
Expand Down Expand Up @@ -38,6 +45,13 @@ export default {
}
}
},
methods: {
setOptions(newVal) {
this.parentContainer.mapObject
.unbindTooltip()
.bindTooltip(this.mapObject, newVal);
},
},
};
</script>

Expand Down

0 comments on commit 2fd50c3

Please sign in to comment.