Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue 3? #83

Closed
9mm opened this issue Oct 16, 2020 · 10 comments
Closed

Vue 3? #83

9mm opened this issue Oct 16, 2020 · 10 comments

Comments

@9mm
Copy link

9mm commented Oct 16, 2020

Hey I was wondering if there were plans to support Vue 3.

@masoudelahi
Copy link

Hey I was wondering if there were plans to support Vue 3.

i'm too

@masoudelahi
Copy link

masoudelahi commented Oct 21, 2020

is it compatible with Vue3 ?

@Agontuk
Copy link
Owner

Agontuk commented Oct 21, 2020

It should work with vue 3 without any changes, please try & let me know if it's not the case.

@SmallComfort
Copy link

@Agontuk In vue3 the $listeners has been removed,I found $listeners is used in your code

@RichPC
Copy link

RichPC commented Nov 18, 2020

@Agontuk just tried it with vue3 and got the following error:

Uncaught TypeError: h is not a function
    at Proxy.render (VueCropper.js?95c3:19)

h needs to be imported with vue3

import { h } from 'vue'

but then as @SmallComfort pointed out the $listeners have gone too.

After importing h, and simply deleting the $listeners line it seems to work a treat in vue3.

@Agontuk
Copy link
Owner

Agontuk commented Nov 28, 2020

I'll add vue 3 support asap, seems like it'll be a breaking change though.

@MarceloLuis1997
Copy link

+1

@Agontuk
Copy link
Owner

Agontuk commented Jan 3, 2021

Master branch now contains vue 3 related changes, you can try & see if it works for you. I'll release a major version soon.

@matslindh
Copy link

For anyone wondering: since this.$refs isn't available in the new setup() in Vue3, you can get a reference to cropper by using ref:

setup(props) {
  const cropper = ref(null);
  return { cropper, }
}

The croppper reference will be populated with a reference to the actual cropperjs instance, and you can access the instance through cropper.value.

@Agontuk
Copy link
Owner

Agontuk commented Feb 1, 2021

v5.0.0 has been published with vue 3 support

@Agontuk Agontuk closed this as completed Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants