v-model="pickerValue" type="monthrange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份" :picker-options="pickerOptions" >
export default {
name: 'Home',
components: {
},
watch:{
pickerValue(){
this.$emit('pickerValueFun',this.pickerValue)
}
},
data(){
return{
pickerValue:"",
pickerOptions:{
disabledDate(time) {
return time.getTime() > Date.now();
}
}
}
}
}
type="datetime"
placeholder="选择日期时间"
@change="handleDate"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
:picker-options="expireTimeOption"
>
data() {
return {
expireTimeOption: {
disabledDate(date) {
//disabledDate 文档上:设置禁用状态,参数为当前日期,要求返回 Boolean
return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
}
},
deadline: "", // 截止时间
}
},
methods:{
// 截止日期
handleDate(value) {
this.deadline = value;
},
}
————————————————