Subscribe on changes!

when use @vue/compat in vue3 project, use emit('update:modelValue', val), v-model not effect

avatar
Sep 18th 2023

Vue version

3.3.4

Link to minimal reproduction

https://localhost:8089/

Steps to reproduce

floow the npm markdown, when use @vue/compat in vue3 project, child use emit('update:modelValue', val),
parent v-model not effect. when commented @vue/compat code, it works

What is expected?

can you give me some suggestions .both use @vue/compat and let it works

What is actually happening?

In parent , v-model not effect

System Info

No response

Any additional comments?

No response

avatar
Sep 18th 2023

Please provide a minimal runnable reproduction.

avatar
Sep 18th 2023

If you are running the compat build in Vue 2 mode, then the parent that is using v-model on your component will listen for ìnput, not update:modelValue`.

You would have to deactivate the COMPONENT_V_MODEL compat flag in your app, or in that parent component's compat config.

https://v3-migration.vuejs.org/migration-build.html#compat-configuration

If that doesn't solve your problem, please provide a runnable reproduction that we can debug, or ask the community in "Discussions" tab or our discord.