My goal is to display a tooltip when a user selects specific text on the page - similar to annotating text.
I have successfully created a v-tooltip
component dynamically. I managed to select the element in JavaScript, but I am struggling to wrap it with the v-tooltip
component. When I did manage to wrap it, the tooltip ended up positioned at the top of the page rather than on the selected element itself. I am questioning whether my approach is the most effective one.
You can view an example on JSFiddle: https://jsfiddle.net/6xk7zLv9/
Is there a better method for generating Vue components dynamically and inserting them into the DOM? How can I properly attach the tooltip to the selected element?