<script>
import Moveable from "vue3-moveable";
import { ref } from "vue";

export default {
    components: { Moveable },
    setup() {
        const targetRef = ref(null);
        const onRender = e => {
            e.target.style.cssText += e.cssText;
        };
        return { targetRef, onRender };
    }
};
</script>
<template>
    <div class="root">
        <div class="container">
            <div
                class="target"
                ref="targetRef"
                style="top: 50px;left: 50px;width: 200px;height: 200px;"
            >Target</div>
            <Moveable
                :target="targetRef"
                :draggable="true"
                :resizable="true"
                :rotatable="true"
                :clippable="true"
                :dragWithClip="true"
                :padding="({ left: 10, right: 10, bottom: 10, top: 10 })"
                @render="onRender"/>
        </div>
    </div>
</template>