即使在babelrc中包含@ babel / plugin-proposal-class-properties之后,也不会对类组件进行编译。
{
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
]
],
"plugins": [
"@babel/plugin-transform-property-literals",
"@babel/plugin-transform-member-expression-literals",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-transform-object-assign",
"array-includes",
"@babel/plugin-proposal-class-properties"
// "@babel/plugin-transform-classes"
]
}