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 🙏

© 2024 – Pkg Stats / Ryan Hefner

axva

v0.1.7

Published

Vue.use(axva,'pt'); //第二个参数接收设置报错语言(默认是中文,自带中文或葡语)

Downloads

13

Readme

Vue表单验证插件

Vue.use(axva,'pt'); //第二个参数接收设置报错语言(默认是中文,自带中文或葡语)

<form v-va='form' errClass='err' :propCheck="propCheck">
    <input type="email" v-model="form.email" prop="email,Email" placeholder="Email" @blur="blur(email)"/>
</form>

data(){
    return {
        ruleValidate:{
            email: {noEmpty: true,min:8,type:'Number'},
        },
        propCheck:0
    }
}
isPass() {
    this.propCheck = 1;
    var isPass = this.$axva();
    if (!isPass.validate) {
        this.$tip(isPass.errMsg);
    } else {
        this.getAjax();
    }
},
blur(n){
    this.$axva_blur(n);
}

errClass:设置错误提示的class,设置后会添加自定义的class,如果不设置,默认是往下添加错误的DOM

propCheck:设置校验方式(不设置默认进入页面马上校验) //可设置离焦校验,需要每个input设置一个离焦并触发这个事件传入input的Name

prop:('需要验证的项目字段名','显示的报错项目名称')

this.$axva():返回验证结果

检测非空: noEmpty: true,

检测最大值length: min: 2

检测最小值length: max: 16

检测最大数值: NumMax:100

检测最小数值: NumMin:1

检测是否包含:'city': { include: [citysList, 'province'], message: '该省份没有包含此城市' },//include接收两个参数,第一个是规则,第二个是查找哪个,需要加message

检测自定义规则:cpf: { other: checkcpf, message: 'cpf错误' },//other接收一个参数,自定的规则,需要加message

检测是否相等:password: { noEmpty: true, equal: 'password_again', min: 6 }, password_again: { noEmpty: true, equal: 'password', min: 6 },

检测是否不相等:'name': { unequal: 'name2' },//unequal接收一个参数,需要对比的值

检测必须选择:service: { accepted: 'service', message: '必须接受协议' },//accepted接收一个参数,需要加message

检测检测正则:'email': { type: "Mail", max: 50 },

包含的正则包含:

ImgCode//图片验证码是否4位数

SmsCode//短信验证码是否4位数字

MailCode//邮件验证码是否4位数字

UserName//用户名4-16位格式

Password//密码6-16位格式

Mobile//手机号码格式

RealName//用户名格式

BankNum//银行卡号码格式

Answer//非空白字符

Mail//邮箱格式

Number//必须数字