IE report vuex requires a Promise polyfill in this browser problem solving

Using Vuex, IE browser error

Because Promise used to deliver asynchronous messages in ES6 is used, and browsers with lower versions of IE do not support it.

Solution

Step 1: Install babel-polyfill. babel-polyfill can simulate the environment used by ES6 and can use all the new methods of ES6

npm install babel-polyfill --save

Step 2: In the build/webpack.base.conf.js file, use "babel-polyfill"

module.exports = {
  entry: {
    app: ["babel-polyfill", "./src/main.js"]
  },
}

replace

module.exports = {
  entry: {
    app:  './src/main.js'
  }
}

  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325342838&siteId=291194637