Support for the experimental syntax 'classProperties' isn't currently

今天在es6的class类中定义箭头函数报错Support for the experimental syntax 'classProperties' isn't currently

        • 产生原因
        • 解决办法

产生原因

没有在webpack.config.js里面或者是.babelrc文件中配置相关插件。

解决办法

下载并配置好即可。

npm i -D @babel/plugin-proposal-class-properties

在babelrc中配置插件:

options: {
     
    plugins: ['@babel/plugin-proposal-class-properties']
    }
},

你可能感兴趣的:(Support for the experimental syntax 'classProperties' isn't currently)