vue-debounce icon indicating copy to clipboard operation
vue-debounce copied to clipboard

Does not work with vue router `navigate`

Open gbkwiatt opened this issue 2 years ago • 2 comments

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>

gbkwiatt avatar Apr 08 '22 07:04 gbkwiatt

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.

dhershman1 avatar Apr 08 '22 15:04 dhershman1

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 ;)

gbkwiatt avatar Apr 08 '22 15:04 gbkwiatt