You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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.
* Update src/guide/mixins.md
Co-authored-by: Stanislav Lashmanov <stasvarenkin@gmail.com>
Co-authored-by: Natalia Tepluhina <tarya.se@gmail.com>
Copy file name to clipboardExpand all lines: src/guide/mixins.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Basics
4
4
5
-
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.
5
+
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.
6
6
7
7
Example:
8
8
@@ -213,6 +213,8 @@ app.mixin({
213
213
})
214
214
```
215
215
216
+
## Precautions
217
+
216
218
In Vue 2, mixins were the primary tool to abstract parts of component logic into reusable chunks. However, they have a few issues:
217
219
218
220
- 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.
0 commit comments