Skip to content

Commit 467ceed

Browse files
authored
fix: make sure at prop is greater than 0 (#2190)
1 parent 1536ad1 commit 467ceed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/client/composables/useClicks.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export function normalizeSingleAtValue(at: RawSingleAtValue): NormalizedSingleCl
1515
console.error(`Invalid "at" prop value: ${at}`)
1616
return null
1717
}
18+
if (v <= 0) {
19+
console.warn(`[Slidev] "at" prop value must be greater than 0, but got ${at}, has been set to 1`)
20+
return 1
21+
}
1822
return v
1923
}
2024

0 commit comments

Comments
 (0)