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

export default {
    components: { Moveable },
    data() {
        const moveableRef = null;
        return { moveableRef };
    },
    methods: { onDrag(e) {
        e.target.style.transform = e.transform;
    } },
    mounted() {
        this.moveableRef = this.$refs.moveableRef;
    }
};
</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>