While converting legacy jquery code, I stuck at getting position of element.
My goal is display floating div
above a
tag.
Here is my
this.markInfoBusStop.markerInfoStyle.left = left + 'px';
Above isn't reactive.
See Doc
for example (you still need to customize to fit your needs.)
data
{
left: 200,
top: 200,
}
method
onMouseEnterBusStop: function(ev) {
this.left = ev.clientX;
this.top = ev.clientY;
}
computed
markerInfoStyle: function(){
return {
left: this.left + 'px',
top: this.top + 'px'
}
}