公司新开发的项目需要兼容到IE9+
就在index.html页面加入
Meta http-equiv="X-UA-Compatible" content="IE=edge">
不起作用
总结方法:
1、兼容IE9/IE10可能会遇到语法或者 Promise错误,安装 babel-polyfill
2、在页面入口配置main.js中引入 babel-polyfill
重新安装一下webpack-dev-server
4、修改 build/webpack.base.conf.js下
5、安装babel-preset-es2015-ie
6、根目录下新建.babelrc
["env",{
"modules": false,"targets": {
"browsers": ["> 1%","last 2 versions","not ie <= 8"]
}
}],"stage-2"
],"plugins": ["transform-runtime"],"env": {
"test": {
"presets": ["env","stage-2"],"plugins": ["istanbul"]
}
}
}
"modules": false,"targets": {
"browsers": ["> 1%","last 2 versions","not ie <= 8"]
}
}],"stage-2"
],"plugins": ["transform-runtime"],"env": {
"test": {
"presets": ["env","stage-2"],"plugins": ["istanbul"]
}
}
}
7、以上操作完成后 运行