File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
src/components/timepicker Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 2323 pattern =" \d*"
2424 class =" form-control text-center"
2525 style =" width : 50px "
26+ @focus =" selectInputValue"
27+ @keyup.up =" keyupArrow(1, 1)"
28+ @keyup.down =" keyupArrow(1, 0)"
2629 @wheel =" hoursWheel"
2730 placeholder =" HH"
28- v-model =" hoursText"
31+ v-model.lazy =" hoursText"
2932 :readonly =" readonly"
3033 maxlength =" 2"
3134 size =" 2" >
3639 pattern =" \d*"
3740 class =" form-control text-center"
3841 style =" width : 50px "
42+ @focus =" selectInputValue"
43+ @keyup.up =" keyupArrow(0, 1)"
44+ @keyup.down =" keyupArrow(0, 0)"
3945 @wheel =" minutesWheel"
4046 placeholder =" MM"
41- v-model =" minutesText"
47+ v-model.lazy =" minutesText"
4248 :readonly =" readonly"
4349 maxlength =" 2"
4450 size =" 2" >
262268 time = time < min ? min : time
263269 }
264270 this .$emit (' input' , new Date (time))
271+ },
272+ selectInputValue (e ) {
273+ setTimeout (function () {
274+ e .target .setSelectionRange (0 , e .target .value .length )
275+ }, 0 )
276+ },
277+ keyupArrow (isHour , isPlus ) {
278+ if (! this .readonly ) {
279+ // e.preventDefault()
280+ this .changeTime (isHour, isPlus)
281+ }
265282 }
266283 }
267284 }
You can’t perform that action at this time.
0 commit comments