- vue 项目在ie浏览器的兼容问题
- 北京棋院PC项目总结
- DOM 库
- 任务13-浏览器兼容
- 笔记:vue搭建项目下载模块
- js内置方法实现base64转换
- 原生发生ajax
- 借助HTML分别禁用IE8, IE9的兼容视图模式(Compat
- Web前端面试指导:谈谈浏览器的兼容性
- {
...
"dependencies": {
"@vue/cli-plugin-babel": "~4.4.0",
"core-js": "^3.15.2",
"regenerator-runtime": "^0.13.7",
}
...
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 9"
]
}
配置babel
babel.config.jsmodule.exports = { presets: [ ['@vue/app', { useBuiltIns: 'entry' }] ], plugins: [ [ 'component', { libraryName: 'element-ui', styleLibraryName: 'theme-chalk' } ] ] };
由于babel默认不处理node-modules里面的文件,故需要将要处理的依赖手动添加到需要处理的列表中
vue.config.jsmodule.exports = { transpileDependencies: ['element-ui'] }
入口文件处添加babel
main.jsimport 'core-js/stable'; import 'regenerator-runtime/runtime';
参考文档:
vue-cli文档之浏览器兼容性
本文标题:Vue-cli3以上版本添加IE兼容
本文链接:https://www.haomeiwen.com/subject/yinvpltx.html