OK I have made some progress setting myDraggable to an Array of Draggable as I am aware the Draggable.create returns an array
Then I needed to pass this.myDraggable[0] in my updateProgress function call
Still confused why the other way didn't work that worked in CodeSandbox didn't work in my app instance but at least now I can happily disable my draggable
Be still interested if you so look at the zip I uploaded if you discover anything but either way thank you very much for your timely responses.
data() {
return {
myDraggable: Array<Draggable>(),
proxy: document.createElement("div"),
};
},
mounted() {
this.init();
},
methods: {
init: function () {
this.myDraggable = Draggable.create(this.proxy, {
trigger: ".wrapper",
type: "x",
inertia: true,
resistance: 0.75,
dragResistance: 0.75,
onDrag: () => this.updateProgress(this.myDraggable[0]),
});
},
updateProgress(myDraggable) {
var debug = document.getElementById("debug");
debug.innerHTML = "draggable.x: " + myDraggable.x;
},
disableDraggable() {
this.myDraggable[0].disable();
},
},