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

export default {
    components: { Moveable },
    data() {
        return {};
    },
    methods: {
        onRender(e) {
            e.target.style.cssText += e.cssText;
        },
        onRender$0(e) {
            e.target.style.cssText += e.cssText;
        }
    }
};
</script>
<template>
    <div class="root">
        <div class="container">
            <p class="description">
                * There is a subpixel issue because offsetLeft and offsetTop are used.
                <br/>
                * You can accurately represent the position of a movable control box.
                <br/>
                * However, since gBCR is used, css zoom should not be used
                <br/>
                * and `transform: rotate` should not be used for container, rootContainer.
            </p>
            <div style="transform-origin: 0 0;transform: scale(2, 2);">
                <div
                    class="target target1"
                    style="position: relative;left: 10.5px;top: 10.5px;width: 100px;height: 40px;line-height: 40px;font-size: 10px;"
                >Not Accurate</div>
            </div>
            <Moveable
                :target="'.target1'"
                :draggable="true"
                :origin="false"
                @render="onRender"/>
            <div style="transform-origin: 0 0;transform: scale(2, 2);">
                <div
                    class="target target2"
                    style="position: absolute;left: 10.5px;top: 50.5px;width: 100px;height: 40px;line-height: 40px;font-size: 10px;"
                >Accurate</div>
            </div>
            <Moveable
                :target="'.target2'"
                :draggable="true"
                :origin="false"
                :useAccuratePosition="true"
                @render="onRender$0"/>
        </div>
    </div>
</template>