1.0.0 • Published 2 years ago
hi-tools v1.0.0
安装
npm install hi-tools
js调用
import hitools from 'hi-tools'
或
const hitools = require('hi-tools')
调用示例:
const result = hitools.hiIsMobile(手机号)
// result : true 或 false
vue组件内调用
import { htIsMobile } from "hi-tools";
调用示例:
const result = hiIsMobile(手机号)
// result : true 或 false
该包提供的工具
中国大陆常用手机号格式
const result = hitools.hiIsMobile(手机号)
// result : true 或 false
0或正整数,切不能以0开头的多位数字例如(0123)
const result = hitools.hiNonnegativeInteger(数字)
// result : true 或 false
大于0,最多两位小数,且不能是以0开头的整数例如(012) -- 适用于常见价格使用
const result = hitools.hiSimilarPrices(数字)
// result : true 或 false
大于0,整数,且不能是以0开头数字例如:(0123)
const result = hitools.hiPositiveInteger(数字)
// result : true 或 false
防抖:默认延时500毫秒、可自定传值
const handleFunction = hitools.debounce(fun,1000)
开源协议
ISC
1.0.0
2 years ago