// 安装core-js@3.0 和 regenerator-runtime
npm install --save core-js@3
npm install --save regenerator-runtime
// babel.config.js
presets: [
[
"@babel/preset-env",
{
useBuiltIns: "entry", // or "usage"
corejs: 3,
}
]
]
// 入口文件main.js最上面
import "core-js/stable";
import "regenerator-runtime/runtime";