feat(Calendar): lazy render

This commit is contained in:
陈嘉涵
2019-12-26 19:59:08 +08:00
committed by neverland
parent 0b721fd87c
commit bfb08c37cb
3 changed files with 158 additions and 102 deletions
+3 -7
View File
@@ -1,12 +1,12 @@
import { createNamespace } from '../../utils';
import { t, bem, formatMonthTitle } from '../utils';
import { t, bem } from '../utils';
const [createComponent] = createNamespace('calendar-header');
export default createComponent({
props: {
title: String,
currentMonth: Date
monthTitle: String
},
methods: {
@@ -19,11 +19,7 @@ export default createComponent({
},
genMonth() {
return (
<div class={bem('month-title')}>
{formatMonthTitle(this.currentMonth)}
</div>
);
return <div class={bem('month-title')}>{this.monthTitle}</div>;
},
genWeekDays() {