vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

Home Page:https://vuejs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[compat] component data is overwritten by mixins

KaelWD opened this issue · comments

commented

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

commented

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