string 字符串格式判断
isIphoneNumber 宽松判断国内手机号
ts
import { isIphoneNumber } from 'fe-toolsbox'
isIphoneNumber('18888888888')
isIphoneNumber('+8618888888888')
isIphoneNumber('008618888888888')
true
true
true
isTelNumber 判断座机号码(带分机号码)
ts
import { isTelNumber } from 'fe-toolsbox'
isTelNumber('0711-98765431')
isTelNumber('0711-98765431-12')
true
true
isIdCard 判断身份证号
ts
import { isIdCard } from 'fe-toolsbox'
isIdCard('432424194509186543')
isIdCard('43242419450918654X')
true
true
isValidIdCard 判断身份证是否有效
ts
import { isValidIdCard } from 'fe-toolsbox'
isValidIdCard('432424194509186543')
isValidIdCard('43242419450918654X')
false
false
isEmail 判断邮箱格式
ts
import { isEmail } from 'fe-toolsbox'
isEmail('test@example.com')
true
isUrl 判断 Url 格式
ts
import { isUrl } from 'fe-toolsbox'
isUrl('https://www.example.com')
isUrl('http://www.example.com')
isUrl('ftp://www.example.com')
true
true
true
isEnglish 判断英文格式
ts
import { isEnglish } from 'fe-toolsbox'
isEnglish('hello')
true
isChinese 判断中文格式
ts
import { isChinese } from 'fe-toolsbox'
isChinese('中国人')
true
isNumberPlate 判断车牌号格式
ts
import { isNumberPlate } from 'fe-toolsbox'
isNumberPlate('粤B99999')
isNumberPlate('粤BA99999')
true
true
isBase64 判断 base64 格式
ts
import { isBase64 } from 'fe-toolsbox'
isBase64('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA')
true
isBankCardNumber 判断银行卡号(包含对公对私)格式
ts
import { isBankCardNumber } from 'fe-toolsbox'
isBankCardNumber('622222222222222222')
true
isStrongPwd 强密码格式校验
ts
import { isStrongPwd } from 'fe-toolsbox'
isStrongPwd('622222222222222222')
isStrongPwd('1@aA666')
是否是强密码:false
是否是强密码:true
checkPwdStrength 检测密码强度
ts
import { checkPwdStrength } from 'fe-toolsbox'
template
<div class="demo">
<div>密码强度:<span >{{checkPwdStrength(pwd)}} </span></div>
<div><input type="text" v-model="pwd" placeholder="请输入密码"></div>
</div>
密码强度:0