mirror of
https://github.com/youzan/vant.git
synced 2026-05-16 01:07:43 +08:00
chore: using includes instead of indexOf (#8261)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user