<template>
<el-form-item label="生效日期" >
<el-date-picker
v-model="dataForm.effectiveDate"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
:picker-options="expireTimeOption"
@change="handleDate">
</el-date-picker>
</el-form-item>
</template>
export default {
data () {
return {
expireTimeOption: {
disabledDate(date) {
//disabledDate 文档上:设置禁用状态,参数为当前日期,要求返回 Boolean
return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
}
},
dataForm: {
effectiveDate: ''
},
}
},
methods: {
handleDate(value) {
this.dataForm.effectiveDate = value;
}
}
}