After the vue-cli+webpack+iview project is launched, it will display normally in other browsers! But the page is blank in 360 browser compatibility mode

problem description

the vue-cli+webpack+iview project will display normally in other browsers after it is launched! But the page is blank in 360 browser compatibility mode! The error is as follows! All ie browsers are incompatible!

clipboard.png

the environmental background of the problems and what methods you have tried

find it on the web because ie is not compatible with promise methods
Solutions
install npm install-- save-dev babel-polyfill
configure in webpack.base.conf.js:
first
entry: {
app: ["babel-polyfill", ". / src/main.js"]
}
second
/ / app: ". / src/main.js",

// "babel-polyfill":"babel-polyfill"

the third type

app: ["./node_modules/babel-polyfill/dist/polyfill.js","./src/main.js"]

fourth
Global import babel-polyfill in main.js

Fifth
Global import babel-polyfill in main.js
the method of adding
/ / dataset to index.js is compatible with IE browsers. Ie10 and below do not support dataset

  if (window.HTMLElement) {
    if (Object.getOwnPropertyNames(HTMLElement.prototype).indexOf("dataset") === -1) {
      Object.defineProperty(HTMLElement.prototype, "dataset", {
        get: function () {
          var attributes = this.attributes // 
          var name = []
          var value = [] // 
          var obj = {} // 
          for (var i = 0; i < attributes.length; iPP) { // 
            if (attributes[i].nodeName.slice(0, 5) === "data-") { // 5"data-"
              // "data-"name
              name.push(attributes[i].nodeName.slice(5));
              // value
              value.push(attributes[i].nodeValue);
            }
          }
          for (var j = 0; j < name.length; jPP) { // namevalue
            obj[name[j]] = value[j]; // obj
          }
          return obj // 
        }
      })
    }
  }
</script>

what result do you expect? What is the error message actually seen?

as a result, the problem was not solved! Ask the great god to teach! I am grateful for my tears

Nov.10,2021

this kind of installation is not recommended. You have to locate the specific code to solve the problem. It is recommended that the development mode accesses the question page through the ie version corresponding to the compatibility mode, and it is easy to deal with specific problems.


https://www.zhihu.com/questio.
lets 360 open a web page without compatibility mode

Menu