我们的志愿者还没有将这篇文章翻译为 中文 (简体)。加入我们帮助完成翻译!
A mixin is a coherent set of methods and properties implemented by other interfaces and classes. The properties and methods are then part of the new interface in the same way as any specific properties and methods.
That definition is a little confusing. I propose we replace it with: A mixin is a class or object which contains one or more methods and/or properties implemented by another interface or class. The properties and methods are then part of the new interface or class and are used just like any explicitly defined by the class or interface.
Learn more
General knowledge
- Mixin on Wikipedia
Technical reference
- Example of a mixin: Body