【modify】使用ESLint格式化代码

This commit is contained in:
zer0Black
2023-03-01 09:33:58 +08:00
parent 694855ae8b
commit 63369b8b87
400 changed files with 42942 additions and 43132 deletions
+14 -15
View File
@@ -1,32 +1,31 @@
//判断是否IE<11浏览器
export function isIE() {
// 判断是否IE<11浏览器
export function isIE () {
return navigator.userAgent.indexOf('compatible') > -1 && navigator.userAgent.indexOf('MSIE') > -1
}
export function isIE11() {
export function isIE11 () {
return navigator.userAgent.indexOf('Trident') > -1 && navigator.userAgent.indexOf('rv:11.0') > -1
}
//判断是否IE的Edge浏览器
export function isEdge() {
// 判断是否IE的Edge浏览器
export function isEdge () {
return navigator.userAgent.indexOf('Edge') > -1 && !isIE()
}
export function getIEVersion() {
let userAgent = navigator.userAgent //取得浏览器的userAgent字符串
let isIE = isIE()
let isIE11 = isIE11()
let isEdge = isEdge()
export function getIEVersion () {
const userAgent = navigator.userAgent // 取得浏览器的userAgent字符串
const isIE = isIE()
const isIE11 = isIE11()
const isEdge = isEdge()
if (isIE) {
let reIE = new RegExp('MSIE (\\d+\\.\\d+);')
const reIE = new RegExp('MSIE (\\d+\\.\\d+);')
reIE.test(userAgent)
let fIEVersion = parseFloat(RegExp['$1'])
const fIEVersion = parseFloat(RegExp.$1)
if (fIEVersion === 7 || fIEVersion === 8 || fIEVersion === 9 || fIEVersion === 10) {
return fIEVersion
} else {
return 6//IE版本<7
return 6// IE版本<7
}
} else if (isEdge) {
return 'edge'
@@ -35,4 +34,4 @@ export function getIEVersion() {
} else {
return -1
}
}
}