babel-polyfill use

VUE item blank problem may be solved by installing the processor babel-polyfill IE.

Since many browsers support es6 is not enough, so babel-polyfill es6 can be converted into the current environment can run (similar to some of the syntax)

installation:

 npm install babel-polyfill --save-dev 

Import main.js

 import 'babel-polyfill'; 

In webpack.base.config.js configuration

1 module.exports = {
2   context: path.resolve(__dirname, '../'),
3   entry: {
4     app: './src/main.js' 
5     // app: ["babel-polyfill", "./src/main.js"]
6   },
7   .......
8 }

As can enter into force, I do not know why? ? ?

 

Guess you like

Origin www.cnblogs.com/daidechong/p/11345105.html