Get right to the solution
The first way:
A. Install the dependency package regenerator-Runtime
B.m ain. Introduced in js
import "core-js/stable";
import "regenerator-runtime/runtime"; And put it at the topCopy the code
C. tabel.config. js:
presets: [
["@vue/cli-plugin-babel/preset", { useBuiltIns: "usage", corejs: 3 }],
],
Copy the code
D. vue.config.js file configuration:
chainWebpack: (config) => {
config.module
.rule("view-design"View-design.test (/view-design.src.*? js$/) .use("babel")
.loader("babel-loader")
.end();
}
Copy the code
Json file, browserslist property setting
"browserslist": [
"1%" >."last 2 versions"."ie>=10"
]
Copy the code
The second way
A. Install the dependency package babel-Polyfill
B.m ain. Lead in js
import "@babel/polyfill";
Copy the code
C. tabel.config. js:
presets: [
"@vue/app"["@babel/preset-env",
{
useBuiltIns: "entry"}]]Copy the code
Json file, browserslist property setting
"browserslist": [
"1%" >."last 2 versions"."ie>=10"
]
Copy the code
Hope can help to the same problem small partner, if the problem is solved, by the way star~, expressed support ha ~, today a little lazy, straightforward ~~~~
Reference: www.jqhtml.com/62466.html