Commit de911833 by 胡悦

fix: 修复月份选择逻辑中当前月不可选的问题

将月份比较条件中的 `this.today.month` 改为 `this.today.month - 1`,使得在当前年份时,当前月份及之前的月份可选,当前月份之后的月份不可选,符合预期行为。
1 parent 044ffaf3

3 MB | W: | H:

3 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
// 未来年份的所有月份都不可选(虽然已经限制了年份切换,但作为兜底) // 未来年份的所有月份都不可选(虽然已经限制了年份切换,但作为兜底)
if (this.displayYear > this.today.year) return true if (this.displayYear > this.today.year) return true
// 当前年份,超过当前月份的不可选 // 当前年份,超过当前月份的不可选
if (this.displayYear === this.today.year && m > this.today.month) return true if (this.displayYear === this.today.year && m > this.today.month - 1) return true
return false return false
}, },
onMonthClick(m) { onMonthClick(m) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!