File tree 1 file changed +18
-7
lines changed
1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -740,13 +740,24 @@ export default defineComponent({
740
740
watch (
741
741
( ) => props . defaultDate ,
742
742
( val ) => {
743
- yearOfCurrentShow . value = val . getFullYear ( ) ;
744
- monthOfCurrentShow . value = val . getMonth ( ) ;
745
-
746
- checkedDate . value . year = val . getFullYear ( ) ;
747
- checkedDate . value . month = val . getMonth ( ) ;
748
- checkedDate . value . day = val . getDate ( ) ;
749
- calculateCalendarOfThreeMonth ( val . getFullYear ( ) , val . getMonth ( ) ) ;
743
+ if ( val instanceof Date ) {
744
+ yearOfCurrentShow . value = val . getFullYear ( ) ;
745
+ monthOfCurrentShow . value = val . getMonth ( ) ;
746
+
747
+ checkedDate . value . year = val . getFullYear ( ) ;
748
+ checkedDate . value . month = val . getMonth ( ) ;
749
+ checkedDate . value . day = val . getDate ( ) ;
750
+ calculateCalendarOfThreeMonth ( val . getFullYear ( ) , val . getMonth ( ) ) ;
751
+ } else if ( Array . isArray ( val ) ) {
752
+ val = val [ 0 ] ;
753
+ yearOfCurrentShow . value = val . getFullYear ( ) ;
754
+ monthOfCurrentShow . value = val . getMonth ( ) ;
755
+
756
+ checkedDate . value . year = val . getFullYear ( ) ;
757
+ checkedDate . value . month = val . getMonth ( ) ;
758
+ checkedDate . value . day = val . getDate ( ) ;
759
+ calculateCalendarOfThreeMonth ( val . getFullYear ( ) , val . getMonth ( ) ) ;
760
+ }
750
761
751
762
if ( isShowWeek . value ) {
752
763
showWeek ( ) ;
You can’t perform that action at this time.
0 commit comments