• Stars
    star
    191
  • Rank 202,877 (Top 4 %)
  • Language
    JavaScript
  • License
    Do What The F*ck ...
  • Created over 8 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🚩Validation plugin for Vue.js

Vuerify

Build Status npm Coverage Status badge-size

Validation plugin for Vue.js

Features

  • Supports both Vue 1.x and 2.0
  • Compact
  • Simple

Demo

Docs

Installation

npm i vuerify -S

install directive

# Vue 1.x
npm i v-vuerify -S

# Vue 2.x
npm i v-vuerify-next -S

Usage

import Vue from 'vue'
import Vuerify from 'vuerify'

Vue.use(Vuerify /*, add rules */)

component

{
  template: `
    <form @submit.prevent="handleSubmit">
      <input type="text" v-model="username">
      <input type="password" v-model="password">
      <input type="password" v-model="conform">
      <input type="submit">
      <ul><li v-for="err in errors" v-text="err"></li></ul>
    </form>
  `,
  data () {
    return {
      username: '',
      password: '',
      conform: ''
    }
  },

  vuerify: {
    username: 'required',
    password: {
      test: /\w{4,}/,
      message: '至少四位字符'
    },
    conform: {
      test (val) {
        return val === this.password
      },
      message: '密码输入不一致'
    }
  },

  computed: {
    errors () {
      return this.$vuerify.$errors
    }
  },

  methods: {
    handleSubmit () {
      if (this.$vuerify.check()) {
        // do sth
      }
    }
  }
}

Development

npm install
npm run dev

TODO

  • English Documentation

License

WTFPL

More Repositories

1

vue-trend

🌈 Simple, elegant spark lines for Vue.js
JavaScript
1,191
star
2

vuep

🎡 A component for rendering Vue components with live editor and preview.
JavaScript
886
star
3

vue-markdown-loader

📇 Convert Markdown file to Vue2.0 component.
JavaScript
702
star
4

laue

🖖📈 Modern charts for Vue 2.0
JavaScript
263
star
5

vue-region-picker

[DEPRECATED]
JavaScript
158
star
6

vuep.run

🏃 An online playground for Vue2.0
Vue
140
star
7

npmarket

🛒 More efficient search for node packages.
Vue
93
star
8

jsdoc-vue

[➡️ https://github.com/Kocal/jsdoc-vuejs] A jsdoc plugin that parses *.vue files.
Vue
69
star
9

vue-tricks

Vue
47
star
10

donate

❤️ Donate to @QingWei-Li
24
star
11

pue-loader

🐍 A more pythonic javascript for Vue component file. (Pug + CoffeeScript + Stylus)
JavaScript
20
star
12

vue-delay

🐌 Delay rendering component for Vue.js
JavaScript
17
star
13

typer

✍️ A simplified publishing tool
TypeScript
12
star
14

vueo

🍟 Easy to get value from vue instance via object paths.
JavaScript
10
star
15

hostext

🔡 Text hosting service
JavaScript
9
star
16

vuetch

👻 [WIP]A Vue 2.0 component that fetches data from a http request.
JavaScript
8
star
17

theme-color

Material theme color generator.
JavaScript
7
star
18

2webpack2

🕳️ Turn configuration of webpack 1 to 2
JavaScript
5
star
19

buble-jest

Jest plugin to use buble and babel(handle ES Modules) for transformation
JavaScript
5
star
20

highlightext

💡 Highlight text service
JavaScript
4
star
21

noop-webpack-plugin

🤷‍♀️ Webpack plugin that does nothing.
JavaScript
4
star
22

nft-swag

TypeScript
3
star
23

pue-syntax-highlight

Sublime Text syntax highlighting for single-file Vue components
3
star
24

htpl

A JavaScript templating engine uses Vue syntax.
TypeScript
3
star
25

vuea

🍔 Easy to drop or replace specified key in an array.
JavaScript
2
star
26

AutoBackupFolder

定时打包备份指定文件夹的程序
C#
2
star
27

MagicCubeReduction-CFOP

用cfop还原魔方, 第一个c#开发的程序,留个念想
C#
2
star
28

Aha

[DEPRECATED] 魔兽世界拍卖行辅助工具(客户端)
JavaScript
2
star
29

ablog

A homework orz
TypeScript
2
star
30

qingwei-li.github.io

HTML
1
star
31

sort

一些sort算法练习
JavaScript
1
star
32

parsedate

Converts a value to a Date
JavaScript
1
star
33

Polish

[DEPRECATED]
JavaScript
1
star
34

global-bin-path

DEPRECATED
JavaScript
1
star
35

site

1
star