解决办法:
cnpm install babel-plugin-transform-decorators-legacy --save-dev
cnpm install @babel/plugin-proposal-decorators --save-dev
然后npm run eject 弹出个性化配置
报错:
This git repository has untracked files or uncommitted changes:
解决:
执行npm run eject 出现问题请执行一下步骤:
1.git add .
2.git commit -am "Save before ejecting"
修改babel部分,添加代码
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/plugin-proposal-class-properties", { "loose" : true }]
]
完成解决!
网友评论