Skip to content

Instantly share code, notes, and snippets.

@voronianski
Last active January 23, 2017 11:34
Show Gist options
  • Save voronianski/c4791d2d9ea4d093eff7852843e8bb99 to your computer and use it in GitHub Desktop.
Save voronianski/c4791d2d9ea4d093eff7852843e8bb99 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
</head>
<body>
<div id="app"></div>
</body>
</html>
import Vue from 'vue/dist/vue';
import VeeValidate from 'vee-validate';
Vue.use(VeeValidate);
const component = Vue.component('some-form', {
template: `
<div>
<input
name="text"
type="text"
v-model="text"
v-validate.initial="text"
data-vv-rules="required|numeric"
data-vv-delay="2000"
/>
<span v-if="errors.has('text')">some error</span>
</div>
`,
data() {
return {
text: ''
};
}
})
const app = new Vue({
template: `
<div>
<div>try to input smth and observe error without delay:</div>
<some-form />
</div>
`,
});
app.$mount('#app');
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"vee-validate": "2.0.0-beta.18",
"vue": "2.1.10"
}
}
'use strict';
var _vue = require('vue/dist/vue');
var _vue2 = _interopRequireDefault(_vue);
var _veeValidate = require('vee-validate');
var _veeValidate2 = _interopRequireDefault(_veeValidate);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_vue2.default.use(_veeValidate2.default);
var component = _vue2.default.component('some-form', {
template: '\n <div>\n <input \n name="text" \n type="text" \n v-model="text" \n v-validate.initial="text" \n data-vv-rules="required|numeric" \n data-vv-delay="2000" \n />\n <span v-if="errors.has(\'text\')">some error</span>\n </div>\n ',
data: function data() {
return {
text: ''
};
}
});
var app = new _vue2.default({
template: '\n <div>\n <div>try to input smth and observe error without delay:</div> \n <some-form />\n </div>\n '
});
app.$mount('#app');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment