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

export default {
    components: { Moveable },
    setup() {
        const moveableRef = ref(null);
        const onDrag = e => {
            e.target.style.transform = e.transform;
        };
        return { moveableRef, onDrag };
    }
};
</script>
<template>
    <div class="root">
        <div
            class="container"
            style="width: 500px;height: 500px;border: 1px solid #ccc;"
        >
            <div
                class="target"
                style="width: 200px;height: 150px;"
            >Target</div>
            <Moveable
                ref="moveableRef"
                :target="'.target'"
                :draggable="true"
                :snappable="true"
                :verticalGuidelines="[0, 100, { pos: 200, className: 'red' }]"
                @drag="onDrag"/>
        </div>
    </div>
</template>