摘要:
修饰器(Decorator)是一个函数,用来修改类的行为。 一、概述 ES6 引入了这项功能,目前 Babel 转码器已经支持Decorator 首先,安装babel-core和babel-plugin-transform-decorators。由于后者包括在babel-preset-stage-0 阅读全文
posted @ 2017-12-07 23:11
古兰精
阅读(4761)
评论(0)
推荐(1)
摘要:
继承与派生类 在ES6之前,实现继承与自定义类型是一个不小的工作。严格意义上的继承需要多个步骤实现 Square继承自Rectangle,为了这样做,必须用一个创建自Rectangle.prototype的新对象重写Square.prototype并调用Rectangle.call()方法。JS新手 阅读全文
posted @ 2017-12-07 22:47
古兰精
阅读(2161)
评论(0)
推荐(0)

浙公网安备 33010602011771号