Skip to content

Commit aaf2fba

Browse files
committed
Add id prop
1 parent b3836b9 commit aaf2fba

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
## [2.3.0] (unreleased)
55
- New way to use as plugin, old is deprecated
6+
- Add `id` prop
67

78

89
## [2.2.0](https://github.com/ankurk91/vue-flatpickr-component/compare/2.1.0...2.2.0)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ The component accepts these props:
137137
| input-class | String / Object | `''` | Add CSS class to input |
138138
| name | String | `'date-time'` | Set input field name |
139139
| required | Boolean | `false` | Make input field required |
140-
140+
| id | String | `'date-time'` | Set input field id |
141141

142142
## Install in non-module environments (without webpack)
143143
* Include required files

examples/App.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
</div>
7272

7373
<div class="form-group">
74-
<label>Select datetime</label>
75-
<flat-pickr :config="configs.dateTimePicker" v-model="form.dateTime" placeholder="Date Time"></flat-pickr>
74+
<label for="datetime-input">Select datetime</label>
75+
<flat-pickr :config="configs.dateTimePicker" id="datetime-input" v-model="form.dateTime" placeholder="Date Time"></flat-pickr>
7676
</div>
7777

7878
<div class="form-group">

src/flatPickr.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<input type="text"
44
class="form-control input"
5+
:id="id"
56
:class="inputClass"
67
:name="name"
78
:placeholder="placeholder"
@@ -46,7 +47,10 @@
4647
required: {
4748
type: Boolean,
4849
default: false
49-
}
50+
},
51+
id: {
52+
type: String,
53+
},
5054
},
5155
data () {
5256
return {

0 commit comments

Comments
 (0)