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

export default {
    components: { Moveable },
    setup() {
        const onDrag = e => {
            console.log(e.dist);
        };
        const onRender = e => {
            e.target.style.cssText += e.cssText;
        };
        return { onDrag, onRender };
    }
};
</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>