antd-design-vue RangePicker組件 設置:mode="['month', 'month']"后,會產生2個問題:
1. 選擇后日期彈窗沒有自動關閉
解決方案: 使用open屬性和openChange事件
2. disabledDate無效
內部使用了默認的禁用函數,並沒有使用我們提供的props.disabledDate
解決方案: 修改源碼
2.1 node_modules\ant-design-vue\es\vc-calendar\src\RangeCalendar.js
函數 disabledStartMonth(大約658行), 增加:
函數 disabledEndMonth,增加:
if (typeof this.$props.disabledDate == "function") {
if (this.$props.disabledDate(month) == true) {
return true;
}
}
Good Luck!