react mobx中@的识别

1.npm run eject
2.npm install mobx mobx-react --save
3.npm install --save-dev babel-plugin-transform-decorators-legacy
4.npm install babel-core babel-loader babel-preset-es2015 babel-plugin-transform-runtime --save-dev
5.在package.json中找到babel配置 添加
  "plugins": ["transform-decorators-legacy"]



6.在根目录下创建jsconfig.js文件
   添加内容:

{
compilerOptions: {
   experimentalDecorators: true;
   emitDecoratorMetadata: true }
}

7.重新运行 yarn start

转载https://www.jianshu.com/p/c17361036eb5并结合实际情况作了修改
posted @ 2018-09-04 12:51  一叶*秋  阅读(442)  评论(0)    收藏  举报

博客侧边栏公告广告位招租