一、
在vue项目中试过,IE浏览器版本是IE11
// js文件--methods 新增一方法,myBrowser () {let userAgent = navigator.userAgentif (userAgent.indexOf("Firefox") > -1) {return "FF"}if (!!window.ActiveXObject || "ActiveXObject" in window || window.navigator.userAgent.indexOf("MSIE") >= 1) {return "IE"}}// 调用const browser = this.myBrowser()if (browser == "IE"){// code...}else if (browser == "FF") {// code..}