Skip to content

Commit 4be33b0

Browse files
author
Nicolò Maria Mezzopera
committed
feat: tooltip slot changes with button on simple example
1 parent 639e553 commit 4be33b0

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

examples/src/components/Simple.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<h3>Simple map</h3>
55
<p>Marker is placed at {{ marker.lat }}, {{ marker.lng }}</p>
66
<p> Center is at {{ currentCenter }} and the zoom is: {{ currentZoom }} </p>
7+
<button @click="showLongTooltip">Toggle Long tooltip</button>
78
</div>
89
<l-map
910
:zoom="zoom"
@@ -15,7 +16,14 @@
1516
:url="url"
1617
:attribution="attribution"/>
1718
<l-marker :lat-lng="marker">
18-
<l-tooltip> I am a tooltip </l-tooltip>
19+
<l-tooltip dynamic>
20+
<div>
21+
I am a tooltip
22+
<p v-show="showParagraph">
23+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque sed pretium nisl, ut sagittis sapien. Sed vel sollicitudin nisi. Donec finibus semper metus id malesuada.
24+
</p>
25+
</div>
26+
</l-tooltip>
1927
</l-marker>
2028
</l-map>
2129
</div>
@@ -40,7 +48,8 @@ export default {
4048
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
4149
marker: L.latLng(47.413220, -1.219482),
4250
currentZoom: 13,
43-
currentCenter: L.latLng(47.413220, -1.219482)
51+
currentCenter: L.latLng(47.413220, -1.219482),
52+
showParagraph: false
4453
};
4554
},
4655
methods: {
@@ -49,6 +58,9 @@ export default {
4958
},
5059
centerUpdate (center) {
5160
this.currentCenter = center;
61+
},
62+
showLongTooltip () {
63+
this.showParagraph = !this.showParagraph;
5264
}
5365
}
5466
};

0 commit comments

Comments
 (0)