File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change 3
3
<label :for =" name" ><slot ></slot ></label >
4
4
5
5
<div v-if =" this.required" class =" input-group" >
6
- <input v-if =" this.required" class =" form-control" :type =" type" :name =" name" :id =" name" required >
6
+ <input
7
+ v-if =" this.required"
8
+ v-model =" value"
9
+ class =" form-control"
10
+ :type =" type"
11
+ :name =" name"
12
+ :placeholder =" placeholder"
13
+ :pattern =" pattern"
14
+ :autocomplete =" autocomplete"
15
+ :id =" name"
16
+ required
17
+ >
7
18
<div class =" invalid-feedback" >
8
19
<p >The given value is not valid</p >
9
20
</div >
10
21
</div >
11
22
<div v-else class =" input-group" >
12
- <input class =" form-control" :type =" type" :name =" name" :id =" name" >
23
+ <input v-model = " value " class =" form-control" :type =" type" :name =" name" :placeholder = " placeholder " :pattern = " pattern " :autocomplete = " autocomplete " :id =" name" >
13
24
</div >
14
25
</div >
15
26
</template >
@@ -25,10 +36,24 @@ export default {
25
36
type: String ,
26
37
default: ' text'
27
38
},
39
+ placeholder: {
40
+ type: String
41
+ },
42
+ pattern: {
43
+ type: String
44
+ },
45
+ autocomplete: {
46
+ type: String
47
+ },
28
48
required: {
29
49
type: Boolean ,
30
50
default: false
31
51
}
52
+ },
53
+ data : function () {
54
+ return {
55
+ value: null
56
+ };
32
57
}
33
58
};
34
59
</script >
You can’t perform that action at this time.
0 commit comments