Form-item label="开始年-月" prop="startDate">
<DatePicker
type="month"
format="yyyy-MM"
v-model="searchForm.startDate"
style="width: 200px"
:options="startOptions"
></DatePicker>
</Form-item>
<Form-item label="结束年-月" prop="endDate">
<DatePicker
type="month"
format="yyyy-MM"
v-model="searchForm.endDate"
style="width: 200px"
:options="endOptions"
></DatePicker>
</Form-item>
data() {
return {
tableHeaders:[],
searchForm:{
startDate: "",
endDate: ""
},
startOptions:{
disabledDate: (date) => {
let data = this.searchForm.endDate == '' ? Date.now() : this.searchForm.endDate
return date > data
}
},
endOptions: {
disabledDate: (date) => {
let data = this.searchForm.startDate == '' ? '' : this.searchForm.startDate
return date<data
}
},
}
},
|