用babel ES6创建注释 [英] Create annotation with babel ES6
本文介绍了用babel ES6创建注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
JavaScript没有与TypeScript注释(所有种类)相同的构造。然而,有一个关于ES7的装饰器的建议,BabelJS确实实现了(使用适当的配置)。 这里是一个很好的描述两者之间的差异的文章。
I m actually developping an application using babeljs and ES6 (with .js files) and I was wondering if it was possible to create annotations, like we can do with typescript, using babeljs and ES6 ?
解决方案
JavaScript doesn't have a construct identical to TypeScript annotations (all kinds of them). There is however a proposal for Decorators for ES7, and BabelJS does implement that (With the appropriate configuration). Here's a nice article describing the differences between the two.
这篇关于用babel ES6创建注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文