UNPKG
@lincy/tnui-vue3-uniapp
Version:
latest (1.0.23)
1.0.23
1.0.21
TuniaoUI for vue3 uniapp
github.com/lincenying/tuniaoui-vue3-uniapp
lincenying/tuniaoui-vue3-uniapp
@lincy/tnui-vue3-uniapp
/
utils
/
rand.ts
13 lines
(11 loc)
•
293 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
/** * 生成0~10000的随机数 */
export
const
generateId = ():
number
=>
Math
.
floor
(
Math
.
random
() *
10000
)
/** * 生成随机数(0 ~ max) *
@param
max 最大值 *
@returns
随机数 */
export
const
getRandomInt
= (
max
:
number
) =>
Math
.
floor
(
Math
.
random
() *
Math
.
floor
(max))