mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-06-01 07:57:27 +00:00
docs: edit class-extends
This commit is contained in:
parent
19e1974afe
commit
83bad90346
@ -713,8 +713,8 @@ function mix(...mixins) {
|
|||||||
class Mix {}
|
class Mix {}
|
||||||
|
|
||||||
for (let mixin of mixins) {
|
for (let mixin of mixins) {
|
||||||
copyProperties(Mix.prototype, new mixin()); // 拷贝实例属性
|
copyProperties(Mix.prototype, mixin); // 拷贝实例属性
|
||||||
copyProperties(Mix.prototype, mixin.prototype); // 拷贝原型属性
|
copyProperties(Mix.prototype, Object.getPrototypeOf(mixin)); // 拷贝原型属性
|
||||||
}
|
}
|
||||||
|
|
||||||
return Mix;
|
return Mix;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user