1 |
|
2 | import { validatorGroup, validator, BaseValidator } from './index';
|
3 |
|
4 | class MyCustomValidator extends BaseValidator {
|
5 | isValid(value) {
|
6 | return !value || value == 'Hello';
|
7 | }
|
8 | }
|
9 |
|
10 | const customValidators = {
|
11 | MyCustomValidator
|
12 | };
|
13 |
|
14 | Vue.component('validator', validator(customValidators));
|
15 | Vue.component('vue-dotnet-validator-group', validatorGroup);
|
16 |
|
17 | Vue.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 |
|
30 | Vue.component('test-async-component', function (resolve, reject) {
|
31 | setTimeout(function () {
|
32 |
|
33 | resolve({})
|
34 | }, 2500)
|
35 | })
|
36 |
|
37 | new Vue({
|
38 | el: '#example-site'
|
39 | });
|