alessiomaffeis / vue-picture-input

Mobile-friendly picture file input component for Vue.js 2-3 with image preview, drag and drop, EXIF orientation, and more
MIT License
887 stars 156 forks source link

Not Vue 3 compatible? -> this.$on is not a function #175

Closed TomDeSmet closed 6 months ago

TomDeSmet commented 6 months ago

Is this not Vue 3 compatible as the docs say? I get the error this.$on is not a function because these events are not supported by Vue 3 anymore. See their docs: https://v3-migration.vuejs.org/breaking-changes/events-api.html#_2-x-syntax

They should be replaced by custom emit events.

I'm migrating a large software package, is this an easy fix or do I need to look for another package?

alessiomaffeis commented 6 months ago

Last time I (manually) tested it on Vue 3 (3.3.4) it worked fine. Do you have more info about where that error is coming from? The component doesn't use $on, but rather it emits custom events already.

TomDeSmet commented 6 months ago

Sorry, totally my bad. I had an old version in my package.json... shame shame shame

alessiomaffeis commented 6 months ago

No worries! 👌🏻