feat: migrate Calendar component
This commit is contained in:
@@ -15,7 +15,7 @@ export default createComponent({
|
||||
methods: {
|
||||
genTitle() {
|
||||
if (this.showTitle) {
|
||||
const title = this.slots('title') || this.title || t('title');
|
||||
const title = this.$slots.title?.() || this.title || t('title');
|
||||
return <div class={bem('header-title')}>{title}</div>;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -31,6 +31,8 @@ export default createComponent({
|
||||
firstDayOfWeek: Number,
|
||||
},
|
||||
|
||||
emits: ['click'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
@@ -183,18 +185,16 @@ export default createComponent({
|
||||
return 'disabled';
|
||||
}
|
||||
|
||||
if (type === 'single') {
|
||||
if (Array.isArray(currentDate)) {
|
||||
if (type === 'multiple') {
|
||||
return this.getMultipleDayType(day);
|
||||
}
|
||||
if (type === 'range') {
|
||||
return this.getRangeDayType(day);
|
||||
}
|
||||
} else if (type === 'single') {
|
||||
return compareDay(day, currentDate) === 0 ? 'selected' : '';
|
||||
}
|
||||
|
||||
if (type === 'multiple') {
|
||||
return this.getMultipleDayType(day);
|
||||
}
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (type === 'range') {
|
||||
return this.getRangeDayType(day);
|
||||
}
|
||||
},
|
||||
|
||||
getBottomInfo(type) {
|
||||
|
||||
Reference in New Issue
Block a user