Commit d596b9e4f8591f36d9bf4f8edf9ae2da6ff3dcec
1 parent
4db5926d
update TimePicker
update TimePicker
Showing
4 changed files
with
14 additions
and
6 deletions
Show diff stats
src/components/date-picker/panel/time-range.vue
... | ... | @@ -30,6 +30,7 @@ |
30 | 30 | @on-pick-click="handlePickClick"></time-spinner> |
31 | 31 | </div> |
32 | 32 | <Confirm |
33 | + v-if="confirm" | |
33 | 34 | @on-pick-clear="handlePickClear" |
34 | 35 | @on-pick-success="handlePickSuccess"></Confirm> |
35 | 36 | </div> |
... | ... | @@ -66,7 +67,8 @@ |
66 | 67 | disabledHours: [], |
67 | 68 | disabledMinutes: [], |
68 | 69 | disabledSeconds: [], |
69 | - hideDisabledOptions: false | |
70 | + hideDisabledOptions: false, | |
71 | + confirm: false | |
70 | 72 | }; |
71 | 73 | }, |
72 | 74 | computed: { | ... | ... |
src/components/date-picker/panel/time.vue
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | @on-pick-click="handlePickClick"></time-spinner> |
16 | 16 | </div> |
17 | 17 | <Confirm |
18 | + v-if="confirm" | |
18 | 19 | @on-pick-clear="handlePickClear" |
19 | 20 | @on-pick-success="handlePickSuccess"></Confirm> |
20 | 21 | </div> |
... | ... | @@ -47,7 +48,8 @@ |
47 | 48 | disabledHours: [], |
48 | 49 | disabledMinutes: [], |
49 | 50 | disabledSeconds: [], |
50 | - hideDisabledOptions: false | |
51 | + hideDisabledOptions: false, | |
52 | + confirm: false | |
51 | 53 | }; |
52 | 54 | }, |
53 | 55 | computed: { | ... | ... |
src/styles/components/time-picker.less
... | ... | @@ -18,10 +18,10 @@ |
18 | 18 | border-left: 1px solid @border-color-split; |
19 | 19 | &:first-child{ |
20 | 20 | border-left: none; |
21 | - border-radius: @btn-border-radius 0 0 0; | |
21 | + border-radius: @btn-border-radius 0 0 @btn-border-radius; | |
22 | 22 | } |
23 | 23 | &:last-child{ |
24 | - border-radius: 0 @btn-border-radius 0 0; | |
24 | + border-radius: 0 @btn-border-radius @btn-border-radius 0; | |
25 | 25 | } |
26 | 26 | ul{ |
27 | 27 | width: 100%; | ... | ... |
test/routers/date.vue
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | <!--style="width: 168px"></time-picker>--> |
25 | 25 | <!--</i-col>--> |
26 | 26 | <i-col span="12"> |
27 | - <Time-picker type="time" :value="value" placeholder="选择时间" style="width: 168px"></Time-picker> | |
27 | + <Time-picker type="timerange" confirm placeholder="选择时间" style="width: 168px"></Time-picker> | |
28 | 28 | <!--<time-picker--> |
29 | 29 | <!--:value="value2"--> |
30 | 30 | <!--type="timerange"--> |
... | ... | @@ -36,6 +36,7 @@ |
36 | 36 | <!--@on-clear="clear"--> |
37 | 37 | <!--style="width: 168px"></time-picker>--> |
38 | 38 | </i-col> |
39 | + <i-button @click="time">time</i-button> | |
39 | 40 | </row> |
40 | 41 | </template> |
41 | 42 | <script> |
... | ... | @@ -43,7 +44,7 @@ |
43 | 44 | data () { |
44 | 45 | return { |
45 | 46 | // value: '2016-12-12 03:03:03', |
46 | - value: '15:12:01', | |
47 | + value: '03:12:01', | |
47 | 48 | value2: ['08:40:00', '09:40:00'], |
48 | 49 | // value2: [new Date(), new Date()], |
49 | 50 | value3: ['2016-12-01', '2016-12-25'] |
... | ... | @@ -60,6 +61,9 @@ |
60 | 61 | }, |
61 | 62 | clear () { |
62 | 63 | console.log('clear'); |
64 | + }, | |
65 | + time () { | |
66 | + this.value = new Date(); | |
63 | 67 | } |
64 | 68 | } |
65 | 69 | } | ... | ... |