Skip to content

Instantly share code, notes, and snippets.

@maxkueng
Created October 2, 2014 17:11
Show Gist options
  • Save maxkueng/9f2349df9464c0cd8cb3 to your computer and use it in GitHub Desktop.
Save maxkueng/9f2349df9464c0cd8cb3 to your computer and use it in GitHub Desktop.
kazupon/vue-validator Issue #6

Issue #6 Example

Run

npm install
npm run build

And the open index.html

<!DOCTYPE html>
<html lang="en">
<head>
<title>¯\_(ツ)_/¯</title>
<meta charset="utf-8" />
</head>
<body>
<div id="app">
<form>
<div>
<label>Text: <input v-model="awesomeText | required" type="text" placeholder="required" /></label>
<p v-show="$validation.awesomeText.required">Text: required</p>
</div>
</form>
<p>The text is: {{awesomeText}}</p>
</div>
<script src="bundle.js"></script>
</body>
</html>
var Vue = require('vue');
var validator = require('vue-validator');
Vue.use(validator)
var v = new Vue({
el: '#app',
data: {
awesomeText: ''
}
});
{
"name": "vue-test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "browserify main.js > bundle.js"
},
"dependencies": {
"vue": "^0.10.6",
"vue-validator": "kazupon/vue-validator"
},
"devDependencies": {
"browserify": "^5.12.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment