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

export default {
    components: { Moveable },
    data() {
        const moveableRef = null;
        return { moveableRef };
    },
    methods: {
        onClick() {
            this.$refs.moveableRef.request("resizable", {
                direction: [1, 0],
                deltaWidth: -49,
                useSnap: true
            }, true);
        },
        onClick$0() {
            this.$refs.moveableRef.request("resizable", {
                direction: [1, 0],
                deltaWidth: 49,
                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"
                :resizable="true"
                :snappable="true"
                :snapGridWidth="50"
                @render="onRender"/>
        </div>
    </div>
</template>