Subscribe on changes!

Inappropriate behavor of compatConfig with feature COMPONENT_V_MODEL on pre-component basis

avatar
Aug 18th 2022

Vue version

3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#eNp9Uk1Lw0AQ/SvDnhRMco9RkNibbQWlp4WyNpM2Zb/Y3bRCyH93smljqyKEJDPz9s3Me9uxJ2vTQ4ssZ4XfuMaGR64bZY0LUO4aWUHtjALO0iyGA5aze64BuMbPiKuwFq0M0A3ZjVFWhNLoutnm0EG5nL8uF7PF+3q1ni+fZy851EJ6hP5ugGuhMCd6GoOzmBkIjEYdPB2PPUdkJYK4uR2bADgMrdPnCEB56sbZDqU0cDROVpyNtX740IueIptWpCCgslIEpAigGJc9JMpUKB84I0LOMqoV2QRkd2yUJlHCpntvNMkWR+CngueMph4bcxa1imOFYH2eZb7eDALufWrcNqO/1LU6NApT9Cr5cObo0RHxSYoTR0bJA7rEoa7QofuP8wf0F+9ZDFpl8nPw/kqMrosqrIRssY+6XZQpnFQE+OsKfLtakpfTLtYZGvjCsqlHDm/BNXp7bdjkFuu/AOjL5ck=

Steps to reproduce

In @vue/compat environment with compat MODE=2, define two components: App and Child. Wherein, Child meets v-model api of vue3. Now, refer to Child in App and deliver value using v-model. I add compatConfig in App: {COMPONENT_V_MODEL: false} to make App action like it is in vue3 env with v-model.

What is expected?

Child could get right value: modelValue

What is actually happening?

Child receives a attribute: value. To achieve expected target, I have to add the same compatConfig in Child.

System Info

No response

Any additional comments?

Strictly speaking, this is not a bug. However, this behavior seem to be not appropriate for two reasons:

  1. A developer has to change parent component's behavior by add config in child.ren component
  2. Generally, we using third-party component more often, so we can not add config in children component. It seem to be more appropriate to add this config in parent component.