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" | |
} | |
} |