@@ -45,7 +45,7 @@ export default {
45
45
},
46
46
data () {
47
47
return {
48
- calendar : {}
48
+ calendarData : {}
49
49
}
50
50
},
51
51
clickDay (data ) {
@@ -56,17 +56,17 @@ export default {
56
56
},
57
57
clickToday (data ) {
58
58
console .log (data); // Jumped to this month
59
+ },
60
+ getSelectedDaysCount (data ){
61
+ console .log (data); // Get Selected Days Count
59
62
}
60
63
}
61
64
````
62
65
63
66
### Template Usage
64
67
` ` ` ` html
65
68
< FunctionalCalendar
66
- // v-model="calendar"
67
-
68
- // :day-names="dayNames" //dayNames=['Su','Mo','Tu','We','Th','Fr','Sa']
69
- // :month-names="monthNames" //monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"]
69
+ // v-model="calendarData"
70
70
71
71
// v-on:choseDay="clickDay"
72
72
// v-on:changeMonth="changeDate"
@@ -90,6 +90,9 @@ export default {
90
90
// :agoDayHide="1514937600" //Do not click before a date. Timestamp 10 digits
91
91
// :futureDayHide="1525104000" //Do not click after a date Timestamp 10 digits
92
92
93
+ // :day-names="dayNames" //dayNames=['Su','Mo','Tu','We','Th','Fr','Sa']
94
+ // :month-names="monthNames" //monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"]
95
+
93
96
// :apply-stylesheet="true"
94
97
>< / FunctionalCalendar>
95
98
````
@@ -101,51 +104,49 @@ arr=[{date:'2018/4/1',className:"mark1"}, {date:'2018/4/13',className:"mark2"}];
101
104
``````
102
105
103
106
## Usage With Configs
104
- ### Component Settings
105
- ` ` ` ` javascript
106
- export default {
107
- components: {
108
- FunctionalCalendar
109
- },
110
- data () {
111
- return {
112
- calendar: {
113
- configs: {
114
- sundayStart: false ,
115
- isDatePicker: false ,
116
- isDateRange: false ,
117
- isMultiple: false ,
118
- calendarsCount: 3 ,
119
- changeMonthFunction: false ,
120
- changeYearFunction: false ,
121
- markDate: [' 2018/10/20' ,' 2018/10/28' , ' 2018/10/16' ],
122
- markDateMore: [{date: ' 2018/11/20' ,className: " mark1" }, {date: ' 2018/11/21' ,className: " mark2" }],
123
- agoDayHide: 0 ,
124
- futureDayHide: 2554387200 ,
125
- dayNames: [' Su' , ' Mo' , ' Tu' , ' We' , ' Th' , ' Fr' , ' Sa' ],
126
- monthNames: [" January" , " February" , " March" , " April" , " May" , " June" , " July" , " August" , " September" , " October" , " November" , " December" ]
127
- isModal: false ,
128
- applyStylesheet: true ,
129
- }
130
- }
131
- }
132
- },
133
- }
134
- ````
135
107
### Template Usage
136
108
` ` ` ` html
137
109
< FunctionalCalendar
138
- // v-model="calendar "
110
+ // v-model="calendarData "
139
111
140
- // :configs="calendar.configs "
112
+ // :configs="calendarConfigs "
141
113
142
114
// v-on:choseDay="clickDay"
143
115
// v-on:changeMonth="changeDate"
144
116
// v-on:isToday="clickToday"
145
117
// v-on:selectedDaysCount="getSelectedDaysCount" // Works only with a date range.
146
118
>< / FunctionalCalendar>
147
119
````
148
-
120
+ ### Component Settings
121
+ ` ` ` ` javascript
122
+ export default {
123
+ components: {
124
+ FunctionalCalendar
125
+ },
126
+ data () {
127
+ return {
128
+ calendarData: {},
129
+ calendarConfigs: {
130
+ sundayStart: false ,
131
+ isDatePicker: false ,
132
+ isDateRange: false ,
133
+ isMultiple: false ,
134
+ calendarsCount: 3 ,
135
+ changeMonthFunction: false ,
136
+ changeYearFunction: false ,
137
+ markDate: [' 2018/10/20' ,' 2018/10/28' , ' 2018/10/16' ],
138
+ markDateMore: [{date: ' 2018/11/20' ,className: " mark1" }, {date: ' 2018/11/21' ,className: " mark2" }],
139
+ agoDayHide: 0 ,
140
+ futureDayHide: 2554387200 ,
141
+ dayNames: [' Su' , ' Mo' , ' Tu' , ' We' , ' Th' , ' Fr' , ' Sa' ],
142
+ monthNames: [" January" , " February" , " March" , " April" , " May" , " June" , " July" , " August" , " September" , " October" , " November" , " December" ]
143
+ isModal: false ,
144
+ applyStylesheet: true
145
+ }
146
+ }
147
+ },
148
+ }
149
+ ````
149
150
150
151
### API
151
152
@@ -154,7 +155,7 @@ arr=[{date:'2018/4/1',className:"mark1"}, {date:'2018/4/13',className:"mark2"}];
154
155
| choseDay | Check the method called on a certain day to return the selected date YY - MM - DD | No |
155
156
| changeMonth | Switch the method called by the month, return the date to switch to a certain month YY-MM-DD | No
156
157
| isToday | When switching the month, if you cut to the current month, call this method and return to the current month today. | No
157
- | selectedDaysCount | Get number of days between date range dates |
158
+ | selectedDaysCount | Get number of days between date range dates | No
158
159
##### Add the ref attribute to the Calendar tab, exposing three methods to switch the month directly
159
160
````javascript
160
161
For example: <FunctionalCalendar ref="Calendar"></FunctionalCalendar>
0 commit comments