@@ -52,6 +52,9 @@ export default {
52
52
autoScrollData1: ' 08:40' ,
53
53
autoScrollData2: ' 5:30:20 pm' ,
54
54
55
+ apmFirst1: ' AM 03:15' ,
56
+ apmFirst2: ' pm9時6分' ,
57
+
55
58
sideNav: [
56
59
{ title: ' Default' , anchor: ' default' },
57
60
{ title: ' 12 Hours' , anchor: ' format12hours' },
@@ -74,7 +77,8 @@ export default {
74
77
{ title: ' @focus and @blur event' , anchor: ' focusAndBlur' },
75
78
{ title: ' Customized Picker Labels' , anchor: ' customPickerLabels' },
76
79
{ title: ' Adjust Input Width' , anchor: ' inputWidth' },
77
- { title: ' Auto-Scroll' , anchor: ' autoScroll' }
80
+ { title: ' Auto-Scroll' , anchor: ' autoScroll' },
81
+ { title: ' More Powerful format String' , anchor: ' morePowerfulFormat' }
78
82
]
79
83
}
80
84
},
@@ -704,14 +708,14 @@ section#mostlyUsedSamples
704
708
| < vue-timepicker hour-label="heure" minute-label="minute">< /vue-timepicker>
705
709
|
706
710
| < !-- 12-hour format with customized am/pm text -->
707
- | < vue-timepicker hour-label="時 " minute-label="分" second-label="秒" apm-label="午" am-text="上午" pm-text="下午" format="h:mm:ss a">< /vue-timepicker>
711
+ | < vue-timepicker hour-label="时 " minute-label="分" second-label="秒" apm-label="午" am-text="上午" pm-text="下午" format="h:mm:ss a">< /vue-timepicker>
708
712
template( v-slot:preview )
709
713
b 24-hour format with customized hour and minute label
710
714
p
711
715
vue-timepicker( hour-label ="heure" minute-label ="minute" )
712
716
b 12-hour format with customized am/pm text
713
717
p
714
- vue-timepicker( hour-label ="時 " minute-label ="分" second-label ="秒" apm-label ="午" am-text ="上午" pm-text ="下午" format ="h:mm:ss a" )
718
+ vue-timepicker( hour-label ="时 " minute-label ="分" second-label ="秒" apm-label ="午" am-text ="上午" pm-text ="下午" format ="h:mm:ss a" )
715
719
716
720
//- Adjust Input Width
717
721
sample-block#inputWidth
@@ -765,6 +769,80 @@ section#mostlyUsedSamples
765
769
p
766
770
vue-timepicker( auto-scroll format ="h:mm:ss a" v-model ="autoScrollData2" )
767
771
772
+ //- More Powerful format String
773
+ sample-block#morePowerfulFormat
774
+ template( v-slot:title ) More Powerful <code >format</code > String
775
+ template( slot ="description" )
776
+ p The <code >format</code > parameter becomes even more powerful started from <code >v1.1.2</code >.
777
+ template( v-slot:codes )
778
+ highlight-code( lang ="html" data-title ="HTML" )
779
+ pre
780
+ | < !-- Use without "hour" -->
781
+ | < vue-timepicker format="mm:ss">< /vue-timepicker>
782
+ | < vue-timepicker format="m:s">< /vue-timepicker>
783
+ |
784
+ | < !-- Make AM/PM the first column in the dropdown -->
785
+ | < vue-timepicker format="A hh:mm" v-model="apmFirst1">< /vue-timepicker>
786
+ | < vue-timepicker format="ah時m分" v-model="apmFirst2" am-text="午前" pm-text="午後">< /vue-timepicker>
787
+ |
788
+ | < !-- Hour + APM only -->
789
+ | < vue-timepicker format="ha">< /vue-timepicker>
790
+ | < vue-timepicker format="hh A">< /vue-timepicker>
791
+ |
792
+ | < !-- One slot only -->
793
+ | < !-- Not recommended, though :) -->
794
+ | < vue-timepicker format="h" input-width="60px">< /vue-timepicker>
795
+ | < vue-timepicker format="mm" input-width="60px">< /vue-timepicker>
796
+ | < vue-timepicker format="ss" input-width="60px">< /vue-timepicker>
797
+ | < vue-timepicker format="a" input-width="60px">< /vue-timepicker>
798
+ highlight-code( lang ="javascript" data-title ="JS" )
799
+ pre
800
+ | // Initial values
801
+ | data () {
802
+ | return {
803
+ | apmFirst1: 'AM 03:15',
804
+ | // -> Equivalent to:
805
+ | // apmFirst1: {
806
+ | // A: 'AM',
807
+ | // hh: '03',
808
+ | // mm: '15'
809
+ | // }
810
+ |
811
+ | apmFirst2: 'pm9時6分'
812
+ | // -> Equivalent to:
813
+ | // apmFirst2: {
814
+ | // a: 'pm',
815
+ | // h: '9',
816
+ | // m: '6'
817
+ | // }
818
+ | }
819
+ | }
820
+ template( v-slot:preview )
821
+ b Use without "hour"
822
+ p
823
+ vue-timepicker( format ="mm:ss" )
824
+ |
825
+ vue-timepicker( format ="m:s" )
826
+ b Make AM/PM the first column in the dropdown
827
+ p
828
+ vue-timepicker( format ="A hh:mm" v-model ="apmFirst1" )
829
+ |
830
+ vue-timepicker( format ="ah時m分" v-model ="apmFirst2" am-text ="午前" pm-text ="午後" )
831
+ b Hour + APM only
832
+ p
833
+ vue-timepicker( format ="ha" )
834
+ |
835
+ vue-timepicker( format ="hh A" )
836
+ b One slot only
837
+ p
838
+ vue-timepicker( format ="h" input-width ="60px" )
839
+ |
840
+ vue-timepicker( format ="mm" input-width ="60px" )
841
+ |
842
+ vue-timepicker( format ="ss" input-width ="60px" )
843
+ |
844
+ vue-timepicker( format ="a" input-width ="60px" )
845
+
768
846
//- Footer Links
769
847
.footer-links
770
848
slot( name ="footer-links" )
0 commit comments