1. 在組件中添加picker-options屬性;官方說明:當前時間日期選擇器特有的選項
<el-date-picker
v-model="addForm.date"
placeholder="請選擇使用日期"
type="date"
value-format="yyyy-MM-dd"
:picker-options="expireTimeOption"
/>
2. 在data函數中return對應的特有的選項expireTimeOption;
expireTimeOption: {
disabledDate(date) {
// 當天可選:date.getTime() < Date.now() - 24 * 60 * 60 * 1000
return date.getTime() < Date.now()
}
}
