js
data () {
return {
// 只能选择2026以后包含2026
pickerOptions: {
disabledDate: (time) => {
let min = '2026-01'
let now = this.timeCopy
min = moment(min).unix()
let max = moment(now).unix()
time = time.getTime() / 1000
return time < min
}
},
}
}
html
<el-col :span="12">
<el-form-item label="结佣月:" :required="true">
<el-date-picker :picker-options="pickerOptions" v-model.trim="condition.salaryDate" @change="disabledDate" type="month" format="yyyy-MM" value-format="yyyyMM" placeholder="请选择">
</el-date-picker>
</el-form-item>
</el-col>