Commit d596b9e4f8591f36d9bf4f8edf9ae2da6ff3dcec

Authored by 梁灏
1 parent 4db5926d

update TimePicker

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