mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
feat(Calendar): add show-mark prop
This commit is contained in:
@@ -7,7 +7,8 @@ export default createComponent({
|
||||
props: {
|
||||
date: Date,
|
||||
days: Array,
|
||||
title: String
|
||||
title: String,
|
||||
showMark: Boolean
|
||||
},
|
||||
|
||||
mounted() {
|
||||
@@ -31,6 +32,12 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
genMark() {
|
||||
if (this.showMark) {
|
||||
return <div class={bem('month-mark')}>{this.date.getMonth() + 1}</div>;
|
||||
}
|
||||
},
|
||||
|
||||
genDay(item) {
|
||||
const { type } = item;
|
||||
|
||||
@@ -65,7 +72,7 @@ export default createComponent({
|
||||
<div class={bem('month')}>
|
||||
{this.genTitle()}
|
||||
<div class={bem('days')}>
|
||||
<div class={bem('month-mark')}>{this.date.getMonth() + 1}</div>
|
||||
{this.genMark()}
|
||||
{this.days.map(this.genDay)}
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user