Skip to content

Commit 165b943

Browse files
committed
Added slots functionality
1 parent 98ac533 commit 165b943

File tree

4 files changed

+41
-6
lines changed

4 files changed

+41
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"name": "vue-functional-calendar",
88
"description": "Lightweight, high-performance calendar component based on Vue.js",
9-
"version": "2.5.4",
9+
"version": "2.5.5",
1010
"license": "MIT",
1111
"repository": {
1212
"type": "git",

src/Demo.vue

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
:is-multiple="true"
88
:calendars-count="1"
99
:with-time-picker="true"
10-
:limits="{min: '25/06/2019', max: '01/07/2019'}"
1110
:change-month-function="true"
12-
></FunctionalCalendar>
11+
v-slot:default="props"
12+
>
13+
{{ props.day.day }}
14+
<span :class="{'green-point': props.day.day === 5, 'orange-point': props.day.day === 9, 'green-line': props.day.day === 11}"></span>
15+
</FunctionalCalendar>
1316
<!--<functional-calendar class="demo-calendar"-->
1417
<!--:with-time-picker='true'-->
1518
<!--:is-date-picker='true'-->
@@ -99,7 +102,7 @@
99102
}
100103
101104
.demo-calendar {
102-
width: 300px;
105+
width: 400px;
103106
/*height: 400px;*/
104107
margin: 100px;
105108
}
@@ -118,4 +121,33 @@
118121
padding-bottom: 20px !ie 7;
119122
max-height: 600px;
120123
}
124+
125+
.green-line {
126+
width: 20px;
127+
position: absolute;
128+
height: 2px;
129+
background-color: #45cc0d;
130+
bottom: 3px;
131+
left: calc(50% - 10px);
132+
}
133+
134+
.green-point {
135+
position: absolute;
136+
width: 4px;
137+
height: 4px;
138+
border-radius: 50%;
139+
background-color: #45cc0d;
140+
bottom: 3px;
141+
left: calc(50% - 4px);
142+
}
143+
144+
.orange-point {
145+
position: absolute;
146+
width: 4px;
147+
height: 4px;
148+
border-radius: 50%;
149+
background-color: #eb9800;
150+
bottom: 3px;
151+
left: calc(50% - 4px);
152+
}
121153
</style>

src/assets/scss/calendar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ input.vfc-single-input {
431431
left: 0;
432432
}
433433

434-
span {
434+
span.vfc-span-day {
435435
display: inline-block;
436436
text-align: center;
437437
width: 30px;

src/components/FunctionalCalendar.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,13 @@
110110
class="vfc-base-end"></div>
111111
<span v-if="!day.hideLeftAndRightDays"
112112
data-date="" :key="day_key"
113+
class="vfc-span-day"
113114
:class="getClassNames(day)"
114115
@click="clickDay(day)"
115116
@mouseover="dayMouseOver(week_key, day.date)">
116-
{{ day.day }}
117+
<slot :week="week" :day="day">
118+
{{ day.day }}
119+
</slot>
117120
</span>
118121
</div>
119122
</div>

0 commit comments

Comments
 (0)