<script>
import Moveable from "vue-moveable";

export default {
    components: { Moveable },
    data() {
        return {};
    },
    methods: {
        onDrag(e) {
            console.log(e.dist);
        },
        onRender(e) {
            e.target.style.cssText += e.cssText;
        }
    }
};
</script>
<template>
    <div class="root">
        <div class="container">
            <div
                class="target"
                style="transform: translate(-50%, -50%);"
            >Target</div>
            <Moveable
                :target="'.target'"
                :resizable="true"
                :preventClickDefault="true"
                :draggable="true"
                @drag="onDrag"
                @render="onRender"/>
        </div>
    </div>
</template>