[Vuejs]-How can live position info of draggable element in Vue?

0👍

You’re trying to assign an object to the position CSS property. This won’t work; position must be a string with a value like relative, absolute, fixed, etc just like in regular CSS.

Try this instead:

data() {
  return {
    style: {
      position: 'absolute',
      left: '238px',
      top: '116px',
    }
  }
}
<div :style="style"></div>

When the element is dragged, just update this.style.left and this.style.top accordingly.

Leave a comment