Skip to content

Commit 214f86d

Browse files
Merge pull request #127 from DKhalil/master
feat: add alwaysUseDefaultClasses prop for day slot
2 parents bcd3e64 + fe7e911 commit 214f86d

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ ___
164164
| arrowsPosition | String | space-between | left, right, space-between | Set arrows position |
165165
| isDark | Boolean | false | true | Dark theme |
166166
| isLayoutExpandable | Boolean | false | true | Enable expanding the calendar layout |
167+
| alwaysUseDefaultClasses | Boolean | false | true | Always add default classes to Day element, even when overriding with a slot |
167168
___
168169
169170
### Slots

src/components/Day.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ export default {
5151
calendar: {
5252
type: Object,
5353
required: true
54+
},
55+
alwaysUseDefaultClasses: {
56+
type: Boolean,
57+
default: false
5458
}
5559
},
5660
data() {
@@ -272,7 +276,7 @@ export default {
272276
getClassNames(day) {
273277
let classes = []
274278
275-
if (!this.hasSlot('default')) {
279+
if (!this.hasSlot('default') || this.alwaysUseDefaultClasses) {
276280
classes.push('vfc-span-day')
277281
}
278282

src/components/FunctionalCalendar.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
:week="week"
163163
:day_key="day_key"
164164
@dayMouseOver="dayMouseOver"
165+
:alwaysUseDefaultClasses="alwaysUseDefaultClasses"
165166
>
166167
<template v-slot:default="props">
167168
<slot :week="props.week" :day="props.day"></slot>

src/mixins/propsAndData.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ export const propsAndData = {
161161
arrowsPosition: {
162162
type: String,
163163
default: 'space-between'
164+
},
165+
alwaysUseDefaultClasses: {
166+
type: Boolean,
167+
default: false
164168
}
165169
},
166170
data() {

0 commit comments

Comments
 (0)