当前位置:网站首页>VUX Datetime 组件compute-days-function动态设置日期列表
VUX Datetime 组件compute-days-function动态设置日期列表
2022-07-30 04:16:00 【黎&&轩】
先看要实现的效果:

选择特定的时间,这就要用到Datetime组件的compute-days-function属性
| 名字 | 类型 | 默认值 | 说明 | 版本要求 |
| compute-days-function | function | 动态设置日期列表,参数为 ({year, month, min, max}, generateRange) | v2.6.1 |
直接上代码
export default {
data() {
return {
computeDaysValue:'',
startDate:'2022-07-27',
endDate:'2022-08-10',
DayList:['29','01','02','05','08'],
}
},
}<datetime format="YYYY-MM-DD" v-model="computeDaysValue" :start-date="startDate" :end-date="endDate" :compute-days-function="computeDaysFunction" title="日期" placeholder="请选择"></datetime>computeDaysFunction(options, generateRange) {
console.log('options',options);
console.log('generateRange',generateRange);
let dayl = [],minD = options.min;
for(let i=minD;i<=options.max;i++){
if(this.DayList.findIndex(sub=>sub==i)>=0){
dayl.push(i);
}
}
return dayl;
},
边栏推荐
猜你喜欢

QT(39)-vs开发qt程序提示无法打开源文件

Pytorch框架学习记录4——数据集的使用(torchvision.dataset)

逆向理论知识3【UI修改篇】

(6) "Digital Electricity" - Diodes and CMOS Gate Circuits (Introduction)

golang八股文整理(持续搬运)

05全局配置文件application.properties详解

WEB penetration of information collection

Redis server启动后会做哪些操作?

@WebServlet注解(Servlet注解)

The difference between forward and redirect
随机推荐
CMake installation and testing
RRU, BBU, AAU
[The Mystery of Cloud Native] Cloud Native Background && Definition && Detailed explanation of related technologies?
SQLSERVER merges subquery data into one field
Charles 替换 接口响应信息
High Concurrency Framework Disruptor
国内首家沉浸式高逼真元宇宙,希元宇宙正式上线
[Node accesses MongoDB database]
骁龙7系芯片表现如何?Reno8 Pro佐证新一代神U
Go 学习笔记(84)— Go 项目目录结构
GCC Rust获批将被纳入主线代码库,或将于GCC 13中与大家见面
获取本机IP和Request的IP
error: The following untracked working tree files would be overwritten by
Mysql version upgrade, copy the Data file directly, the query is very slow
为什么突然间麒麟 9000 5G 版本,又有库存了?
Pytorch framework learning record 7 - convolutional layer
(题目练习)条件概率+权值线段树+FWT+后缀数组
phpoffice edit excel document
Pytorch framework learning record 3 - the use of Transform
Usage of exists in sql