internet-explorer-11 - 我已经使用 create single-spa 创建了 single-spa 应用程序,它在除 IE11 之外的所有浏览器中都能正常工作
解决方案
您是否添加了以下脚本以使单水疗中心在 IE 11 中工作?
<script>
if (typeof fetch === 'undefined') {
document.write('<script src="https://cdn.jsdelivr.net/npm/whatwg-fetch@3.4.0/dist/fetch.umd.js"><\/script>')
}
if (typeof String.prototype.startsWith === 'undefined' || typeof Promise === 'undefined') {
document.write('<script src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7.10.4/dist/polyfill.min.js"><\/script>')
}
</script>
此外,single-spa 中使用的 Webpack 5 默认不支持 IE11。要使其支持 IE11,您需要target: ['web', 'es5']
在webpack.config.js中指定。
有关更多信息,您可以参考这个类似的线程。如果你仍然不能让它在 IE11 中工作,你可以使用这个工作示例。它在 IE11 和其他浏览器中运行良好。
推荐阅读
- python - TypeError:类型对象为关键字参数“训练”获得了多个值,但未解决降级 keras==2.3.1
- php - 自定义帖子类型:标签未在 Wordpress 中显示
- linux - 使用包含空变量的 -t 传递的 ssh 远程命令执行正在切换用户并且不打印请求的远程命令输出
- c++ - 何时更喜欢 lambda 而不是带有 std::async 的打包任务?
- javascript - 如何将 jsfiddle 模型中的 jQuery 代码集成到 Divi 中?
- java - 测试在 IntelliJ 和 maven-surefire-plugin 中有效,但在 maven-failsafe-plugin 中失败
- chronicle - Chronicle Map - 字段的值正在交换位置
- eclipse - 如何使用 Eclipse Debug 特性获取代码流的入口和出口点
- node.js - MongoDB with Node, SyntaxError: Invalid shorthand property initializer
- ansible - 是否可以通过 ansible 和 vmware 模块分配 IP 地址?