Skip to content

Fix mixin data merging documentation #1902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

vetruvet
Copy link
Contributor

@vetruvet vetruvet commented Dec 7, 2018

The current documentation states that data defined by a mixin gets merged with the component's data using a shallow merge. This is not true - the merge is actually a recursive one. This is a small wording change so that the documentation correctly describes current behavior.

This behavior can be easily seen in the source for the function that merges data (in optionMergeStrategies): https://github.com/vuejs/vue/blob/master/src/core/util/options.js#L48. The function will recursively merge keys from both objects.

@chrisvfritz chrisvfritz merged commit 8f1cad8 into vuejs:master Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants