ES6 method写法与TypeError: is not a constructor
公司前端最近开始强推ESlint,很多文件需要逐步修改为符合ESlint规则的形式。
结果遇到了一个神奇的问题,有一段类似这样的代码:let obj = {
init: function($el) { // 此处ESlint检查提示‘Expect method shorthand.(Object-shorthand)’
this.$el = $el;
}
};
原创
2016-11-16 21:11:00 ·
41431 阅读 ·
0 评论