使用vue-cli创建的项目,创建了class类,如:person.js
class Person{
constructor(name, age){
}
}
然后在vue文件中引入这个js,
const p = new Person();
控制台报错了:
person.js:1 Uncaught Error: Module parse failed: Unexpected token (12:32)
File was processed with these loaders:
* ./node_modules/eslint-loader/index.js
You may need an additional loader to handle the result of these loaders.
尝试在bable.config.js中添加:
plugins: ["@babel/plugin-proposal-class-properties"],
也没有用,请问怎么解决这个问题?