elemet ui 时间区间不可超过1年

news/2024/7/10 1:20:41 标签: ui, vue
<el-form-item prop="dateArea" label="交易时间:">
                <el-date-picker
                  type="date"
                  placeholder="选择开始日期"
                  v-model="ruleForm.dateArea1"
                ></el-date-picker>
                <span style="margin: 0 5px;">-</span>
                <el-date-picker
                  type="date"
                  placeholder="选择结束日期"
                  v-model="ruleForm.dateArea2"
                  :picker-options="EndDateOptions"
                ></el-date-picker>
            </el-form-item>

时间区间不可超过1年

EndDateOptions: {
        disabledDate: (time) => {
          return time.getTime() > new Date(this.ruleForm.dateArea1).setFullYear(new Date(this.ruleForm.dateArea1).getFullYear()+1) || time.getTime() < new Date(this.ruleForm.dateArea1).setFullYear((new Date(this.ruleForm.dateArea1).getFullYear()-1))
        }
      },

http://www.niftyadmin.cn/n/1367718.html

相关文章

Vue全家桶构建项目

步骤一、安装vue-cli 首先&#xff0c;我们可以通过npm安装vue-clic,前提是我们需要有node环境&#xff0c;如果电脑还没安装node&#xff0c;先安装&#xff0c;可通过 node -v 查询node的版本号&#xff0c;有版本号则已经安装成功&#xff1b; vue全家桶项目构建教程 接下…

Vue下载文件不成功及下载文件名称问题

看代码 import axiosDown from "axios";downloadFile(path) {return axiosDown({url: path,method: "get",responseType: "blob" // 这一步也很关键&#xff0c;一定要加上 responseType 值为 blob});},downloadWay(item) {// console.log(item…

js代码优化

1.避免多条件并列 let status process; let arr [process, wait, fail] if (arr.includes(status)) {console.log(避免多条件并列--2);}

C++ day44

1、全局变量&#xff0c;int monster 10000;定义英雄类hero&#xff0c;受保护的属性string name&#xff0c;int hp,int attcKk;公有的无参构造&#xff0c;有参构造&#xff0c;虚成员函数void AtK()[blood-0,}&#xff0c;法师类继承自英雄类&#xff0c;私有属性int ap_at…

JS大坑之17位(含)以后的Number类型数值精度丢失问题

1.JS大坑之17位&#xff08;含&#xff09;以后的Number类型数值精度丢失问题 console.log("1318855614830125158")console.log(Number("1318855614830125158"))console.log(parseInt("1318855614830125458"))console.log(String(13188556148301…

js 数组及对象数组去重

一. 对象数组去重 1.es6方法 new Map() function quChong() {let arr [{id: 1,name: 111},{id: 1,name: 111},{id: 2,name: 222},{id: 3,name: 333}];console.log(arr);console.log(--------------------);let arr1 unique(arr);console.log(arr1);};function unique(arr) {…

vue-element-table 表头错乱问题及过滤器失效问题

1.问题描述&#xff1a;table使用时候 动态控制表头 v-if的时候表头错乱,没有安装代码的顺序显示 解决方法&#xff1a;加key, :key“Math.random()” 2.列表的数据需要过滤时&#xff0c;会出现过滤器失效情况&#xff0c;也可用该办法 <el-table-columnlabel"提货…

Vue项目 .env .env.development .env.production 配置说明

1.模式 模式是 Vue CLI 项目中一个重要的概念。默认情况下&#xff0c;一个 Vue CLI 项目有三个模式&#xff1a; development 模式用于 vue-cli-service serveproduction 模式用于 vue-cli-service build 和 vue-cli-service test:unittest 模式用于 vue-cli-service test:un…