npm install @babel/plugin-proposal-decorators
安装后再package.json里面加一句话(babel里面plugins那句):
"babel": {
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
]
],
"presets": [
"react-app"
]
},