fix(Calendar): incorrect month title after auto scroll (#5569)

This commit is contained in:
neverland
2020-01-14 10:52:39 +08:00
committed by GitHub
parent 25574aab72
commit 2047db68d9
3 changed files with 9 additions and 3 deletions

View File

@@ -80,6 +80,10 @@ export default createComponent({
},
methods: {
scrollIntoView() {
this.$refs.days.scrollIntoView();
},
getDayType(day) {
const { type, minDate, maxDate, currentDate } = this;
@@ -166,12 +170,14 @@ export default createComponent({
genDays() {
if (this.visible) {
return (
<div class={bem('days')}>
<div ref="days" class={bem('days')}>
{this.genMark()}
{this.days.map(this.genDay)}
</div>
);
}
return <div ref="days" />;
},
genDay(item, index) {