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并结合实际情况作了修改

猜你喜欢

转载自www.cnblogs.com/boonook/p/9583758.html