Skip to content

Commit 908f7de

Browse files
committed
fix date-picker bug
1 parent a0b1e5c commit 908f7de

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

example/components/date-picker.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,13 @@
132132
if (findIndex !== -1) {
133133
this.tempIndex[2] = findIndex
134134
} else {
135-
this.day = this.day < this.days[0].value ? this.days[0].value : this.days[this.days.length - 1].value
135+
if (this.day < this.days[0].value) {
136+
this.day = this.days[0].value
137+
this.tempIndex[2] = 0
138+
} else {
139+
this.day = this.days[this.days.length - 1].value
140+
this.tempIndex[2] = this.days.length - 1
141+
}
136142
}
137143
138144
this.dateData = [this.years, this.months, this.days]

0 commit comments

Comments
 (0)