Skip to content

Commit

Permalink
fix: Cannot read properties of undefined (reading 'split')
Browse files Browse the repository at this point in the history
  • Loading branch information
MellowCo committed Apr 5, 2024
1 parent a0e5da2 commit 4691f27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/handlers/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export function auto(str: string) {
}

export function rem(str: string) {
if (!str)
return
if (str.match(unitOnlyRE))
return `1${str}`
const match = str.match(numberWithUnitRE)
Expand Down Expand Up @@ -123,6 +125,8 @@ export function percent(str: string) {
}

export function fraction(str: string) {
if (!str)
return
if (str === 'full')
return '100%'
// 小程序百分比 / 改为 _
Expand Down

0 comments on commit 4691f27

Please sign in to comment.