File tree 3 files changed +19
-3
lines changed 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ export default {
92
92
| first-day-of-week | Number | 7 | set the first day of week (1-7) |
93
93
| input-class | String | 'mx-input' | the input class name |
94
94
| input-name | String | 'date' | the input name attr |
95
+ | input-attr | Object | | the input attr(eg: { required: true, id: 'input'}) |
95
96
| confirm-text | String | 'OK' | the default text to display on confirm button |
96
97
| range-separator | String | '~ ' | the range separator text |
97
98
| date-format | String | '' | format the time header and tooltip |
Original file line number Diff line number Diff line change 12
12
<div class =" mx-input-wrapper"
13
13
@click =" showPopup" >
14
14
<input
15
+ :class =" inputClass"
16
+ :name =" inputName"
17
+ v-bind =" inputAttr"
15
18
ref =" input"
16
19
type =" text"
17
20
autocomplete =" off"
18
- :class =" inputClass"
19
- :name =" inputName"
20
21
:disabled =" disabled"
21
22
:readonly =" !editable"
22
23
:value =" text"
@@ -185,6 +186,7 @@ export default {
185
186
type: [String , Array ],
186
187
default: ' mx-input'
187
188
},
189
+ inputAttr: Object ,
188
190
appendToBody: {
189
191
type: Boolean ,
190
192
default: false
Original file line number Diff line number Diff line change @@ -13,6 +13,17 @@ afterEach(() => {
13
13
} )
14
14
15
15
describe ( 'datepicker' , ( ) => {
16
+ it ( 'prop: inputAttr' , ( ) => {
17
+ wrapper = mount ( DatePicker , {
18
+ propsData : {
19
+ inputAttr : { required : true , id : 'input' }
20
+ }
21
+ } )
22
+ const input = wrapper . find ( 'input' ) . element
23
+ expect ( input ) . toHaveProperty ( 'required' , true )
24
+ expect ( input ) . toHaveProperty ( 'id' , 'input' )
25
+ } )
26
+
16
27
it ( 'prop: appendToBody' , ( ) => {
17
28
wrapper = mount ( DatePicker , {
18
29
propsData : {
@@ -366,7 +377,9 @@ describe('calendar-panel', () => {
366
377
367
378
it ( 'click: prev/next year' , ( ) => {
368
379
wrapper = mount ( CalendarPanel , {
369
- value : new Date ( 2018 , 4 , 5 )
380
+ propsData : {
381
+ value : new Date ( 2018 , 4 , 5 )
382
+ }
370
383
} )
371
384
const nextBtn = wrapper . find ( '.mx-icon-next-year' )
372
385
const lastBtn = wrapper . find ( '.mx-icon-last-year' )
You can’t perform that action at this time.
0 commit comments