cyhnkckali / vue3-color-picker

The Unlicense
55 stars 9 forks source link

v-model does not work in vue-compat mode ? #25

Open jclaessens97 opened 4 months ago

jclaessens97 commented 4 months ago

Hi, I just tried implementing this component in vue-compat mode to migrate from a vue 2 version, but it seems like v-model isn't working?

Reproduction https://stackblitz.com/edit/vitejs-vite-jmvspw?file=vite.config.js,src%2Fcomponents%2FColorPicker.vue,src%2FApp.vue&terminal=dev

cyhnkckali commented 4 months ago

I don't know how I should organise the component for vue-compat mode?

Do you have any idea for the following warning?

https://v3-migration.vuejs.org/breaking-changes/v-model.html

‘Component declares “modelValue” prop, which is Vue 3 usage, but is running under Vue 2 compat v-model behaviour. You can opt-in to Vue 3 behaviour on a per-component basis with compatConfig: { COMPONENT_V_MODEL: false }

cyhnkckali commented 4 months ago

Hi @kaskenov , Do you have an opinion on this?

jclaessens97 commented 4 months ago

@cyhnkckali I also noticed that that's probably the cause, however if I don't use v-model but explicitly bind to :model-value and listen to update:model-value, it also doesn't work.

I tried their suggestions of setting it to MODE 3 or to disable that COMPONENT_V_MODEL flag, but neither work 🤔

I currently don't really know what you could've done differently to be honest 😬

cyhnkckali commented 4 months ago

Let's think about it. I'd like to make this right. =)