npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vr_input_h

v2.7.1

Published

input-box with validation

Readme

rule-input

input-box with validation,基于input输入框封装,并带有验证规则

一、安装与配置

1、安装npm包 
npm install rule-input

2、配置vue项目中的main.js文件
import ruleInput from'rule-input'
Vue.use(ruleInput)

二、使用说明

 使用模板:		
<rule-input	inType="name" placeholder="请输入姓名" :clearable="true" style=”width:50px;font-size:15px;”></rule-input>
 参数:
1、inType
确定输入框类型
输入框类型       intype
姓名             chinaName
密码             chinaPassword
身份证号         iDNumber
手机号           chinaMobile
邮箱             chinaMail
用户名           chinaUserName
2、placeholder
输入框提示信息
3、style
自定义样式
4、class
自定义样式

5、clearable 清空输入框内容,默认为false。

三、验证规则

 1、姓名
限制长度:1-20字;
校验格式:除“·”外不允许输入特殊字符,当输入”.”或”。”时,自动识别为”·”;
校验方式:在输入过程中进行实时校验。
 2、密码
限制长度:6-20字;
校验格式:支持数字、字母大小写、标点符号(空格除外)。
校验方式:在失去焦点时进行校验。
 3、邮箱
限制长度:30字
校验格式:
①邮箱格式必须为【登录名】@【主机名】.【域名】;
②邮件地址中有且仅有一个@符号,必须要有”.”,且不能以”.”作为开始或结束字符,地址中可出现多个”.”,但不能连续,如,”..”;
③登录名和主机名都不能为空;
④登录名允许使用英文字母、数字、”_”、”-”、”.”;
⑤主机名不能使用_作为开始符和结束符,不能含有/ * ? ,等字符;
⑥整个地址中不允许输入空格;
⑦当开始输入登录名时,自动推荐匹配常用邮箱地址域名。
校验方式:在失去焦点时进行校验
 4、二代身份证号
限制长度:18字
校验格式:
公民身份号码是特征组合码,由十七位数字本体码和一位校验码组成。排列顺序从左至右依次为:六位数字地址码,八位数字出生日期码,三位数字顺序码和一位数字校验码(数字校验码为1-10,当为10时,用X表示)。
校验方式:在失去焦点时进行校验
 5、大陆手机号
限制长度:11字;
校验格式:大陆手机号码格式为11位纯数字,从左到右依次是三位数字运营商码,四位数字地区码,四位数字顺序码,不允许输入数字外的其他字符;
校验方式:在失去焦点时进行校验。
 6、用户名
限制长度:6-12位;
校验格式:由数字、汉字、字母、字符构成(空格除外)
校验方式:在失去焦点时进行校验。