New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

vreg

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vreg

全局校验

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

vreg

A Vue.js project

使用方式

// main.js
import vreg from 'vreg'
vreg(Vue)

// 自定义指令
// template
<div v-reg:basic="{rule: 'c', msg: 'error3', tag: 'c', test: c}"></div>
<input  v-model="a" v-reg:basic="{rule: 'a', msg: 'error1', tag: 'a', test: a}">
<button  v-reg:basic.check="{check: switch}" @click="ck">click me</button>
// basic   分组
// rule    规则
// msg     提示信息
// tag     分组下的子项
// test    需校验的字段
// check   表示这个是触发校验的开关
// switch  true / false  需要异步执行  不然不生效
【js使用方式】
import {check} from 'vreg/src/lib/rule.js'
export default {
  methods: {
    ck() {
      this.switch = true
      setTimeout(()=> {
        this.switch = false
      })
      if(check('basic')) {
        console.log('ok');
      }
    }
  }
}

FAQs

Package last updated on 24 Jan 2018

Did you know?

Socket

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