Socket
Socket
Sign inDemoInstall

vue2-common-validator

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue2-common-validator

Vue2.0项目中常用的各种验证规则集合,仅适用于国内地区。


Version published
Maintainers
1
Install size
43.6 kB
Created

Readme

Source

common-validator

Vue2.0项目中常用的各种验证规则集合,仅适用于国内地区。

如何使用

  • 通过NPM加载依赖

    npm install --save vue2-common-validator

  • 配置Main.js

import commonValidator from 'vue2-common-validator'
Vue.use(commonValidator);

手机号码验证

checkLoginForm: {
	phone: [
	  {
	    validator: this.$commonValidator.phone,
	    trigger: "blur,change"
	  }
	]
}

姓名验证

checkNameForm: {
	realname: [
	  {
	    validator: this.$commonValidator.realname,
	    trigger: "blur,change"
	  }
	]
}

身份证验证

checkIdCardForm: {
	idcard: [
	  {
	    validator: this.$commonValidator.idcard,
	    trigger: "blur,change"
	  }
	]
}

Keywords

FAQs

Last updated on 14 Dec 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc