mobx装饰器使用报错指南

一 react中使用mobx:

.首先
npm install --save-dev babel-plugin-transform-decorators-legacy
.之后在package中找到babel配置添加
"plugins": ["transform-decorators-legacy"]
.针对编译器报错
用js 新建jsconfig.json 用typescript 新建jsconfig.json
内容为:
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}

猜你喜欢

转载自blog.csdn.net/qq_26383604/article/details/78890218
今日推荐