在这里插入图片描述

1、在这里插入图片描述

在这里插入图片描述

2、

在这里插入图片描述

pickerOptions: {
                    disabledDate(time){
                        let currentTime=that.duration[0]
                        let threeMonths=60*60*1000*24*90
                        if(currentTime){
                            return time.getTime() >currentTime.getTime() + threeMonths || time.getTime() < currentTime.getTime() - threeMonths
                        }
                    },
                    onPick({minDate,maxDate}){
                        // 当第一时间选中才设置禁用
                        if(minDate && !maxDate){
                            that.duration[0]=minDate
                        }
                        if(maxDate){
                            that.duration[1]=maxDate
                        }
                    },
                    shortcuts: [{
                        text: '最近一周',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近一个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近三个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                            picker.$emit('pick', [start, end]);
                        }
                    }],
                    
                },
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐