UNPKG
vue-fluctuation
Version:
latest (1.0.1)
1.0.1
1.0.0
0.1.1
0.1.0
a simple vue-component for the fluctuation of data
yanggoing.github.io
Yanggoing/vue-fluctuation
vue-fluctuation
/
src
/
components
/
validator.js
9 lines
(7 loc)
•
266 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
export
function
digitalValidator
(
value
) {
return
/^(\d|\.|,){1}$/
.
test
(value.
toString
()); }
export
function
looseDigitalValidator
(
value
) {
if
(value ===
undefined
|| value ===
null
|| value ===
''
)
return
true
;
return
/^(\d|\.|,)+$/
.
test
(value.
toString
()); }