chore: using includes instead of indexOf (#8261)

This commit is contained in:
neverland
2021-03-04 11:07:54 +08:00
committed by GitHub
parent 831091182a
commit 9fd71923f9
13 changed files with 31 additions and 31 deletions
+3 -3
View File
@@ -66,13 +66,13 @@ export function unitToPx(value: string | number): number {
}
if (inBrowser) {
if (value.indexOf('rem') !== -1) {
if (value.includes('rem')) {
return convertRem(value);
}
if (value.indexOf('vw') !== -1) {
if (value.includes('vw')) {
return convertVw(value);
}
if (value.indexOf('vh') !== -1) {
if (value.includes('vh')) {
return convertVh(value);
}
}