import { createNamespace } from '../../utils'; import { t, bem } from '../utils'; const [createComponent] = createNamespace('calendar-header'); export default createComponent({ props: { title: String, subtitle: String, showTitle: Boolean, showSubtitle: Boolean, }, methods: { genTitle() { if (this.showTitle) { const title = this.slots('title') || this.title || t('title'); return
{title}
; } }, genSubtitle() { if (this.showSubtitle) { return
{this.subtitle}
; } }, genWeekDays() { const weekdays = t('weekdays'); return (
{weekdays.map((item) => ( {item} ))}
); }, }, render() { return (
{this.genTitle()} {this.genSubtitle()} {this.genWeekDays()}
); }, });