小编Ale*_*lex的帖子

React 应用程序在 IE 11 浏览器中不起作用

我在这里看到了很多类似的问题,我已经尝试了所有方法,但我不知道为什么仍然没有显示任何内容。

  1. npm install react-app-polyfill

  2. 我在 package.json 的生产和开发数组中添加了“ie 11”

  3. 将此两行添加import "react-app-polyfill/ie11"; import "react-app-polyfill/stable";到顶部index.js

  4. 删除 node_modules 中的 .cache 文件夹

  5. 重启应用

但仍然没有在 ie 11 中显示任何内容。

这是我的 package.json

{
  "name": "firealarm",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.3.3",
    "@testing-library/user-event": "^7.1.2",
    "antd": "^3.26.2",
    "axios": "^0.19.0",
    "core-js": "^3.6.1",
    "cors": "^2.8.5",
    "jspdf": "^1.5.3",
    "jspdf-autotable": "^3.2.11",
    "react": "^16.12.0",
    "react-app-polyfill": "^1.0.5",
    "react-dom": "^16.12.0",
    "react-router-dom": "^5.1.2",
    "react-scripts": "3.3.0"
  },
  "scripts": {
    "start": "set PORT=3006 && react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": …
Run Code Online (Sandbox Code Playgroud)

polyfills internet-explorer-11 reactjs create-react-app

5
推荐指数
2
解决办法
6281
查看次数