Open websharik opened 2 years ago
+1
Just in case anyone else lands here and is struggling with the same issue, you can see the solution in the documentation:
https://github.com/robinrodricks/vue3-touch-events#passing-parameters-to-the-event-handler
You shouldn't pass your changes directly in the event as:
v-touch:swipe.left="showSidebar=false"
Instead have a method that returns a callback to set the updates:
v-touch:swipe="toggleSidebar"
And in your methods something like:
methods: {
toggleSidebar() {
return (direction) => {
this.showSidebar = direction === 'right';
}
}
}
Just in case anyone else lands here and is struggling with the same issue, you can see the solution in the documentation:
https://github.com/robinrodricks/vue3-touch-events#passing-parameters-to-the-event-handler
You shouldn't pass your changes directly in the event as:
v-touch:swipe.left="showSidebar=false"
Instead have a method that returns a callback to set the updates:v-touch:swipe="toggleSidebar"
And in your methods something like:
methods: { toggleSidebar() { return (direction) => { this.showSidebar = direction === 'right'; } } }
WOW! This worked like a charm. I remember Vue docs suggest this pattern. I still can not understand how this works differently?
v-touch:swipe.left="showSidebar=false" v-touch:swipe.right="showSidebar=true"
Maximum recursive updates exceeded. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.
node -v //v16.13.1
Events not working.