IE模板 vue2+Element UI

0 阅读1分钟

dev和build都支持IE,较新ES标准支持

仓库:github.com/QLing-yes/v…

image.png

Vue2-IE 兼容项目

基于 Vue 2 + Element UI 的 IE11 兼容前端项目

技术栈

类别技术
框架Vue 2.6.14
路由Vue Router 3.5.1
UIElement UI 2.15.14
垫片core-js、regenerator-runtime、whatwg-fetch

快速开始

pnpm install
pnpm run serve
pnpm run build

兼容性实现

Polyfill 加载顺序 (main.js)

1. whatwg-fetch          → fetch API 兼容
2. core-js/stable        → ES6+ 特性(主要 polyfill,覆盖 95%+)
3. regenerator-runtime   → async/await
4. ES_Polyfill           → 补充特性(87行)

ES_Polyfill 支持列表(仅 core-js 未覆盖的 IE11 原生缺失特性)

类型方法/特性说明
PromisewithResolvers()ES2024 新特性
StringreplaceAll()ES2021 新特性
Symbol完整实现IE11 不存在
Set完整实现IE11 不存在
Map完整实现IE11 不存在
WeakSet完整实现IE11 不存在
WeakMap完整实现IE11 不存在

注:core-js 3.x 已覆盖大部分 ES6+ 特性(Object.assign、Array.includes、String.startsWith 等),仅以上特性未被覆盖。

项目结构

src/
├── main.js              // 入口:polyfill 顺序加载
├── App.vue              // 根组件
├── router/              // 路由配置
└── utils/
    └── ES_Polyfill.js   // 补充兼容(87行)