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



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:


Bind a click event to the path, then use that event’s target to get the title attribute.


Thanks, it works!