|
在es6中,mixins不能使用了,官方也不再推荐使用mixins,es6中如何实现mixins功能? 替代方案: 1. 高阶函数 2. es7 Decorators 修饰符 实现原理及具体细节:https://www.jianshu.com/p/1eaa48067a86 原文参考Mixins Are Dead. Long Live Composition 译文参考Mixin 已死,Composition 万岁 中文参考http://www.jianshu.com/p/4780... 有点像达尔文的进化论, 迭代过程中总有些地方需要消失, 但总会用更好的方式去替代 转自:https://segmentfault.com/q/1010000009044497 |
|
|