vue项目兼容 edge和ie

vue项目 edge和ie打开都空白,有时还会报错;
方法如下:

1、安装babel-polyfill,

npm install babel-polyfill --save

2、在main.js里引入,

import 'babel-polyfill' 

一定要在最上面引入

3、vue.config.js

require('babel-polyfill')

module.exports 里添加:

transpileDependencies: [
    'iview',
    'axios',
  ]
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章