vue-touch-events icon indicating copy to clipboard operation
vue-touch-events copied to clipboard

Migrate plugin for VueJS 3

Open XjulI1 opened this issue 4 years ago • 4 comments

XjulI1 avatar Dec 19 '20 19:12 XjulI1

It changes the bind function to mount, can it still support Vue 2 ?

jerrybendy avatar Dec 21 '20 05:12 jerrybendy

works fine with vue3! I think it should be merged. Maybe we can create another branch for vue3?

Suxsem avatar Mar 19 '21 14:03 Suxsem

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,
})

jerrybendy avatar Mar 19 '21 14:03 jerrybendy

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

robinrodricks avatar Apr 30 '21 09:04 robinrodricks