vue-debounce
vue-debounce copied to clipboard
Does not work with vue router `navigate`
When using router navigate, I get error from router
vue-router.esm.js?8c4f:1244 Uncaught TypeError: Cannot read properties of undefined (reading 'metaKey')
Version of Vue
"vue": "^2.6.10"
"vue-router": "^3.5.2"
To Reproduce
<router-link v-slot="{navigate}" custom :to="{ name: 'Page' }">
<div v-debounce:200="navigate" debounce-events="click"> Button </div>
</router-link>
Interesting, nice catch. So many different usage areas for the tool.
I'll get a testing environment setup with router and see if I can't do a little research.
No worries, I did some work around using route
and in debounce () => $router.push(route.fullPath)
so
<router-link v-slot="{route}" custom :to="{ name: 'Page' }">
<div v-debounce:200="() => $router.push(route.fullPath)" debounce-events="click"> Button </div>
</router-link>
Great job btw, it works for everything else and works very well ;)