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

export default {
    components: { Moveable },
    setup() {
        const onDrag = e => {
            e.target.style.transform = e.transform;
        };
        const onResize = e => {
            e.target.style.width = `${e.width}px`;
            e.target.style.height = `${e.height}px`;
            e.target.style.transform = e.drag.transform;
        };
        return { onDrag, onResize };
    }
};
</script>
<template>
    <div class="root">
        <div class="target">Target</div>
        <Moveable
            :target="'.target'"
            :draggable="true"
            :resizable="true"
            :edgeDraggable="true"
            :edge="['w', 'e']"
            @drag="onDrag"
            @resize="onResize"/>
    </div>
</template>