How to access data from the SVG map with Vue.js


#1

0

I use SVG map of Austria. Each province has “title” attribute which contains a name of the province.

[full example available in the snippet below]

Outside the map in my HTML I have a paragraph, where I want to display the name of the province that was clicked by the user.

{{ province }}

How can I achieve that?

Here is my snippet with my code: https://mdbootstrap.com/snippets/jquery/marektchas/500840?view=project


#2

Bind a click event to the path, then use that event’s target to get the title attribute. https://mdbootstrap.com/snippets/jquery/temp/502289


#3

Thanks, it works!