probil / vue-moveable

↔️ ↕️ 🔄 Vue.js wrapper for Moveable
https://vue-moveable.netlify.com/
MIT License
966 stars 69 forks source link

How to change default container for controls? #158

Open usmanibrahim74 opened 4 years ago

usmanibrahim74 commented 4 years ago

Hello I'm new to vue and I'm using vue-moveable in a subcomponent and but controls are moving all over the page. I want them in that component only. I tried using the container prop mentioned in API documentation. like this

data: function () {
            return {
                moveable: {
                    container: document.getElementById('html-container'),
                    draggable: true,
                    throttleDrag: 0,
                    resizable: false,
                    throttleResize: 1,
                    keepRatio: false,
                    scalable: true,
                    throttleScale: 0,
                    rotatable: true,
                    throttleRotate: 0,
                    pinchable: true, // ["draggable", "resizable", "scalable", "rotatable"]
                    origin: false,
                }
            }
        },

in vue dev tools it shows null, I'm assuming it is running before the component is rendered or etc. any way to achieve the required functionality?

CesarGomezTissini commented 4 years ago

https://github.com/probil/vue-moveable/issues/28#issuecomment-550036539