From 64592cd461460ca8e94d2825273efcd3d061ddb6 Mon Sep 17 00:00:00 2001 From: Stanislav Lashmanov Date: Mon, 20 Jul 2020 17:03:12 +0300 Subject: [PATCH 1/2] Improve Mixins page State that: 1. Mixins are a __simple__ way to reuse component logic, rather than a flexible way to do it. The term __flexible__ goes into conflict with the last chapter of the page, which describes that mixins are in fact inflexible. 2. Add a section title for Precautions. --- src/guide/mixins.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/guide/mixins.md b/src/guide/mixins.md index 7776858a59..5bd1af212d 100644 --- a/src/guide/mixins.md +++ b/src/guide/mixins.md @@ -2,7 +2,7 @@ ## Basics -Mixins are a flexible way to distribute reusable functionalities for Vue components. A mixin object can contain any component options. When a component uses a mixin, all options in the mixin will be "mixed" into the component's own options. +Mixins are a simple way to distribute reusable functionalities for Vue components. A mixin object can contain any component options. When a component uses a mixin, all options in the mixin will be "mixed" into the component's own options. Example: @@ -213,6 +213,8 @@ app.mixin({ }) ``` +## Precautions + In Vue 2, mixins were the primary tool to abstract parts of component logic into reusable chunks. However, they have a few issues: - Mixins are conflict-prone: Since properties from each feature are merged into the same component, you still have to know about every other feature to avoid property name conflicts and for debugging. From dd5177eb43cb0896e096fb6c160782e85a4936bb Mon Sep 17 00:00:00 2001 From: Natalia Tepluhina Date: Sat, 19 Sep 2020 15:42:17 +0300 Subject: [PATCH 2/2] Update src/guide/mixins.md Co-authored-by: Stanislav Lashmanov --- src/guide/mixins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/mixins.md b/src/guide/mixins.md index 5bd1af212d..b5c89f7fd2 100644 --- a/src/guide/mixins.md +++ b/src/guide/mixins.md @@ -2,7 +2,7 @@ ## Basics -Mixins are a simple way to distribute reusable functionalities for Vue components. A mixin object can contain any component options. When a component uses a mixin, all options in the mixin will be "mixed" into the component's own options. +Mixins distribute reusable functionalities for Vue components. A mixin object can contain any component options. When a component uses a mixin, all options in the mixin will be "mixed" into the component's own options. Example: