npm i es6-promise

npm install --save babel-polyfill

 

package.json 文件中 添加

dependencies:{

    "es6-promise": "^4.2.4"

},

devDependencies:{

    "babel-polyfill": "^6.26.0",

}

 

main.js 文件添加

import 'babel-polyfill'

import promise from 'es6-promise'

promise.polyfill()

 

build文件夹下webpack.base.conf.js

module.exports = {

    context: path.resolve(__dirname, '../'),

entry: {

    app: ['babel-polyfill', './src/main.js']

}

Logo

前往低代码交流专区

更多推荐