UNPKG
wux-weapp
Version:
latest (3.11.3)
3.11.3
3.11.2
3.11.1
3.11.0
3.10.1
3.10.0
3.9.0
3.8.9
3.8.8
3.8.7
3.8.6
3.8.5
3.8.4
3.8.3
3.8.2
3.8.1
3.8.0
3.7.2
3.7.1
3.7.0
3.6.1
3.6.0
3.5.0
3.4.2
3.4.1
3.4.0
3.3.2
3.3.1
3.3.0
3.2.0
3.1.0
3.0.6
3.0.5
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
一套组件化、可复用、易扩展的微信小程序 UI 组件库
github.com/wux-weapp/wux-weapp
wux-weapp/wux-weapp
wux-weapp
/
packages
/
core
/
helpers
/
shared
/
bound.js
11 lines
(10 loc)
•
228 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
export
const
bound
= (
position, min, max
) => {
let
ret = position
if
(min !==
undefined
) { ret =
Math
.
max
(position, min) }
if
(max !==
undefined
) { ret =
Math
.
min
(ret, max) }
return
ret }