vue-moveable
vue-moveable copied to clipboard
setState method not working in 1.8.2 version
I just updated to 1.8.2 version of this plugin and I cannot set values for my state;
https://github.com/probil/vue-moveable/issues/84#issuecomment-609399892
I removed additional moveable instance from this.$refs.moveable.setState(); but it still do not work.
I have got something like this in mounted function:
this.$refs.moveable.setState(() => {
this.moveable.scalable = true;
this.moveable.resizable = false;
this.moveable.keepRatio = true;
this.moveable.draggable = true;
this.moveable.rotatable = true;
});
And my data:
data() {
return {
moveable: {
draggable: false,
resizable: false,
scalable: false,
rotatable: false,
keepRatio: true,
pinchable: true,
snappable: true,
verticalGuidelines: [100, 200, 300],
horizontalGuidelines: [0, 100, 200],
renderDirections: ["nw", "ne", "sw", "se"],
container: document.getElementById(`${this.parentId}`),
className: `moveable-box moveable-${this.el.id}`,
target: '.target'
}
}
}
Hi @katOstrynska
Are there any errors in the console when you call this.$refs.moveable.setState ? Can you tell me what's the sign that it's not work?
BTW if you use v-bind with moveable you can change moveable configuration in your instance's data directly. Component will sync that change with inner moveable instance automatically