Subscribe on changes!

[compat] component data is overwritten by mixins

avatar
May 30th 2021

Version

3.1.0-beta.6

Reproduction link

https://codepen.io/kaelwd/pen/JjWOrpq?editors=1011

Steps to reproduce

Consume a mixin that defines its own data

What is expected?

The mixin data should be merged with the component data

What is actually happening?

Only the mixin data is used. If there are instead two mixins that define data, deepMergeData throws an error and nothing is rendered: https://codepen.io/kaelwd/pen/gOmXGew?editors=1011

avatar
May 30th 2021

Should deepMergeData return to at the end? mergedDataFn's return is always undefined otherwise.

https://github.com/vuejs/vue-next/blob/cd337149353d03446850b5f45b817f3fa160e5ff/packages/runtime-core/src/compat/data.ts#L6-L22