Skip to content

Commit 2fd50c3

Browse files
authored
Merge pull request #718 from kuromoka/tooltip-options-reactive
Fix LTooltip options to reactive
2 parents e333b7f + 50c7760 commit 2fd50c3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/components/LTooltip.vue

+14
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ import { tooltip, DomEvent } from 'leaflet';
99
export default {
1010
name: 'LTooltip',
1111
mixins: [Popper, Options],
12+
props: {
13+
options: {
14+
type: Object,
15+
custom: true,
16+
default: () => ({}),
17+
},
18+
},
1219
mounted() {
1320
const options = optionsMerger(this.popperOptions, this);
1421
this.mapObject = tooltip(options);
@@ -38,6 +45,13 @@ export default {
3845
}
3946
}
4047
},
48+
methods: {
49+
setOptions(newVal) {
50+
this.parentContainer.mapObject
51+
.unbindTooltip()
52+
.bindTooltip(this.mapObject, newVal);
53+
},
54+
},
4155
};
4256
</script>
4357

0 commit comments

Comments
 (0)