This repository was archived by the owner on Jun 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +26
-0
lines changed Expand file tree Collapse file tree 5 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ const data = () => ({
115
115
label: ' Website' ,
116
116
name: ' website' ,
117
117
customClass: ' col-12' ,
118
+ helper: ' Pstt... psst, this is a hint' ,
118
119
validations: [new FormValidation (url, ` Format of Url is incorrect` )],
119
120
}),
120
121
new FormField ({
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ export function FormField({
17
17
options = [],
18
18
placeholder = null ,
19
19
inline = false ,
20
+ rows = null ,
21
+ cols = null ,
22
+ helper,
20
23
}) {
21
24
this .id = id;
22
25
this .type = type;
@@ -29,6 +32,9 @@ export function FormField({
29
32
this .options = options;
30
33
this .placeholder = placeholder;
31
34
this .inline = inline;
35
+ this .rows = rows;
36
+ this .cols = cols;
37
+ this .helper = helper;
32
38
}
33
39
```
34
40
@@ -43,17 +49,22 @@ export function FormControl({
43
49
value = null ,
44
50
validations = [],
45
51
label = null ,
52
+ form,
46
53
name = null ,
47
54
customClass = null ,
48
55
options = [],
49
56
placeholder = null ,
57
+ rows = null ,
58
+ cols = null ,
50
59
errors = {},
51
60
valid = true ,
52
61
touched = false ,
53
62
dirty = false ,
63
+ helper,
54
64
}) {
55
65
this .id = id || ` ${ form} -${ name} ` ;
56
66
this .type = type;
67
+ this .form = form;
57
68
this .value = value;
58
69
this .validations = validations;
59
70
this .label = label;
@@ -65,5 +76,8 @@ export function FormControl({
65
76
this .valid = valid;
66
77
this .touched = touched;
67
78
this .dirty = dirty;
79
+ this .rows = rows;
80
+ this .cols = cols;
81
+ this .helper = helper;
68
82
}
69
83
```
Original file line number Diff line number Diff line change 45
45
:onFocus =" onFocus"
46
46
:onBlur =" onBlur"
47
47
/>
48
+ <p class =" form-hint" v-if =" formControl.helper" >
49
+ {{ formControl.helper }}
50
+ </p >
48
51
<div v-if =" showErrors" >
49
52
<p
50
53
v-for =" (errorText, $index) in errorMessages"
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export function FormControl({
15
15
valid = true ,
16
16
touched = false ,
17
17
dirty = false ,
18
+ helper,
18
19
} ) {
19
20
this . id = id || `${ form } -${ name } ` ;
20
21
this . type = type ;
@@ -32,6 +33,7 @@ export function FormControl({
32
33
this . dirty = dirty ;
33
34
this . rows = rows ;
34
35
this . cols = cols ;
36
+ this . helper = helper ;
35
37
}
36
38
37
39
export function FormField ( {
@@ -48,6 +50,7 @@ export function FormField({
48
50
inline = false ,
49
51
rows = null ,
50
52
cols = null ,
53
+ helper,
51
54
} ) {
52
55
this . id = id ;
53
56
this . type = type ;
@@ -62,6 +65,7 @@ export function FormField({
62
65
this . inline = inline ;
63
66
this . rows = rows ;
64
67
this . cols = cols ;
68
+ this . helper = helper ;
65
69
}
66
70
67
71
export function FormValidation (
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ $input-error-color: #dc3545;
27
27
margin-bottom : 0.5rem ;
28
28
}
29
29
30
+ .form-hint {
31
+ font-size : 12px ;
32
+ }
33
+
30
34
.form-group {
31
35
width : 100% ;
32
36
margin-bottom : 1rem ;
You can’t perform that action at this time.
0 commit comments