vue-touch-events
vue-touch-events copied to clipboard
Migrate plugin for VueJS 3
It changes the bind function to mount, can it still support Vue 2 ?
works fine with vue3! I think it should be merged. Maybe we can create another branch for vue3?
I reviewed all changes and found that the only differences are the name of lifetime functions. Such as change bind to beforeMount and change unbind to unmounted. And how about let the directive has all of the two versions of functions? Like below:
function beforeMount() {
// blah blah
}
function unmounted() {
// blah blah
}
app.directive('touch', {
beforeMount: beforeMount,
unmounted: unmounted,
bind: beforeMount,
unbind: unmounted,
})
It seems like there was no activity on this for Vue 3 so I created a functional Vue 3 plugin for this and published it on npm
https://www.npmjs.com/package/vue3-touch-events
https://github.com/robinrodricks/vue3-touch-events
I hope this is okay @jerrybendy and @XjulI1