Skip to content

Commit 1a80da0

Browse files
Improve Mixins page (#285)
* 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>
1 parent a0345d8 commit 1a80da0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/guide/mixins.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Basics
44

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.
66

77
Example:
88

@@ -213,6 +213,8 @@ app.mixin({
213213
})
214214
```
215215

216+
## Precautions
217+
216218
In Vue 2, mixins were the primary tool to abstract parts of component logic into reusable chunks. However, they have a few issues:
217219

218220
- 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

Comments
 (0)