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

export default {
    components: { Moveable },
    setup() {
        const moveableRef = ref(null);
        const onClick = () => {
            moveableRef.value.request("resizable", {
                direction: [1, 0],
                deltaWidth: -49,
                useSnap: true
            }, true);
        };
        const onClick$0 = () => {
            moveableRef.value.request("resizable", {
                direction: [1, 0],
                deltaWidth: 49,
                useSnap: true
            }, true);
        };
        const onRender = e => {
            e.target.style.cssText += e.cssText;
        };
        return { onClick, onClick$0, moveableRef, onRender };
    }
};
</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>