nb-vue-validator
validator fro vue project
Last updated 6 years ago by shaohualou .
ISC · Repository · · Tarball
$ nbnpm install nb-vue-validator 
Private package

nb-vue-validator

Usage

import {
  isMobile,
  isNumber,
  isEmail
} from 'nb-vue-validator'

let mobile = '13088888888'
if (isMobile(mobile)) {
  // TODO
}

Methods

isCN 验证中文

isMobile 验证手机号

isIdNumber 验证身份证

isEmail 验证邮件

isNumber 数字 (number) @force {Boolean} 是否强制验证类型

isInt 整数 (int)

isZero 是否是0

isPositiveInt 正整数(含0)

isUrl 是否是合法网址

isMoney 校验金额

isPassword 校验密码

isDecimal 验证小数2位或4位

isDecimalFour 验证小数4位

isFourDecimal 最多四位小数

isDouDecimal 验证小数2位

isNine 验证 0-99 之间的整数

isFtoN 验证 1-99 之间的整数

isFtoHn 验证 1-999之间的整数

isEcpInteger 非0正整数

isToFn 1-9999

isToTh 1-30正整数

Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (9)

Copyright © newbanker.cn