Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于应用mobx时因为缺少ES7的Decorators支持而报错的问题 #2

Open
ckinmind opened this issue Mar 3, 2017 · 0 comments

Comments

@ckinmind
Copy link
Owner

ckinmind commented Mar 3, 2017

在Counter的demo中应用了mobx, 但是开始运行的时候总是报错,报错信息如下

 Decorators are not officially supported yet in 6.x pending a proposal update. 
However, if you need to use them you can install the legacy decorators transform with:

npm install babel-plugin-transform-decorators-legacy --save-dev

and add the following line to your .babelrc file:

{
  "plugins": ["transform-decorators-legacy"]
}

Decorators 装饰者模式是ES7中提案,要支持这个需要安装一个babel-plugin-transform-decorators-legacy 的插件,并且需要修改.babelrc中的配置

@ckinmind ckinmind changed the title 关于应用mobx时因为缺少ES7的Decorators而报错的问题 关于应用mobx时因为缺少ES7的Decorators支持而报错的问题 Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant