UNPKG

785 BJavaScriptView Raw
1/* global Vue */
2import { validatorGroup, validator, BaseValidator } from './index';
3
4class MyCustomValidator extends BaseValidator {
5 isValid(value) {
6 return !value || value == 'Hello';
7 }
8}
9
10const customValidators = {
11 MyCustomValidator
12};
13
14Vue.component('validator', validator(customValidators));
15Vue.component('vue-dotnet-validator-group', validatorGroup);
16
17Vue.component('test-component', {
18 data() {
19 return {
20 inputValue: ''
21 }
22 },
23 watch: {
24 inputValue() {
25 console.log('watcher, ', this.inputValue);
26 }
27 }
28});
29
30Vue.component('test-async-component', function (resolve, reject) {
31 setTimeout(function () {
32 // Pass the component definition to the resolve callback
33 resolve({})
34 }, 2500)
35})
36
37new Vue({
38 el: '#example-site'
39});