<script>
import Moveable, { DraggableRequestParam } from "vue-moveable";

export default {
    components: { Moveable },
    data() {
        const moveableRef = null;
        return { moveableRef };
    },
    methods: {
        onClick() {
            this.$refs.moveableRef.request("draggable", {
                deltaX: -49,
                deltaY: 0,
                useSnap: true
            }, true);
        },
        onClick$0() {
            this.$refs.moveableRef.request("draggable", {
                deltaX: 49,
                deltaY: 0,
                useSnap: true
            }, true);
        },
        onRender(e) {
            e.target.style.cssText += e.cssText;
        }
    },
    mounted() {
        this.moveableRef = this.$refs.moveableRef;
    }
};
</script>
<template>
    <div class="root">
        <button @click="onClick">Left</button>
        <button @click="onClick$0">Right</button>
        <div class="container">
            <div class="target">Target</div>
            <Moveable
                ref="moveableRef"
                :target="'.target'"
                :draggable="true"
                :snappable="true"
                :snapGridWidth="50"
                @render="onRender"/>
        </div>
    </div>
</template>