refactor(utils): remove isFF (#6507)

* refactor(utils): remove isFF

* chore: remove isObject
This commit is contained in:
btea
2022-03-10 11:30:10 +08:00
committed by GitHub
parent a7f90cc517
commit d9b8ec2164
3 changed files with 4 additions and 12 deletions

View File

@@ -1,5 +1,4 @@
import { rAF, cAF } from '@element-plus/utils'
import { isFF } from '../utils'
import { rAF, cAF, isFirefox } from '@element-plus/utils'
import type { ComputedRef } from 'vue'
@@ -43,7 +42,7 @@ export const useGridWheel = (
xOffset += x
yOffset += y
if (!isFF) {
if (!isFirefox()) {
e.preventDefault()
}

View File

@@ -1,5 +1,4 @@
import { rAF, cAF } from '@element-plus/utils'
import { isFF } from '../utils'
import { rAF, cAF, isFirefox } from '@element-plus/utils'
import { HORIZONTAL, VERTICAL } from '../defaults'
import type { ComputedRef } from 'vue'
@@ -50,7 +49,7 @@ const useWheel = (
offset += newOffset
if (!isFF) {
if (!isFirefox()) {
e.preventDefault()
}

View File

@@ -1,4 +1,3 @@
import { isObject } from '@vue/shared'
import {
FORWARD,
BACKWARD,
@@ -86,8 +85,3 @@ export function renderThumbStyle({ move, size, bar }, layout: string) {
return style
}
export const isFF =
typeof navigator !== 'undefined' &&
isObject(navigator) &&
/Firefox/i.test(navigator.userAgent)