{ margin: 0; font: 12px "Helvetica Neue" }
p.p2 { margin: 0; font: 12px "PingFang SC" }
span.s1 { font: 12px "Helvetica Neue" }

需求:由于月份选择框会给默认接收的月份文本加入高亮显示,但需求要求将选中的月份标记高亮展示。

实现:使用elementUI的日期选择器提供的下拉框样式配置,并改写对应的样式实现。

懒得说话,直接上代码:

<template>
<div>
<dataPickSelf
size='mini'
v-model="scope.row.dateTime"
type="month"
:picker-options="pickerOptions"
:clearable="false"
:popper-class='dataPick'
value-format="yyyy-MM"
ref="dateMonth"
>
</dataPickSelf>
</div>
</template>
<script>
import {DatePicker} from 'element-ui';
export default {
data() {
return {
maxTime: '',
dataPick: 'monthtime',
pickerOptions:{
disabledDate: time => {
return this.timeRe(time);
},
}
}
},
components: {
dataPickSelf:DatePicker
},
methods: {
timeRe(time) {
return time.getTime() >=new Date(this.maxTime).getTime() ;
}
}
}
</script>
<style lang="less" scoped>
.monthtime .el-month-table td.current:not(.disabled) .cell{
font-weight: bold !important;
color:#182452 !important;
}
.monthtime .el-month-table td.today .cell{
color: #182452;
}
.monthtime .el-month-table td.current ~ td.today .cell{
color: #606266;
}
.monthtime .el-month-table td.current ~ td.disabled.today .cell{
color: #C0C4CC !important;
}
.monthtime .el-month-table tr td.disabled.today .cell{
color: #C0C4CC !important;
}
.monthtime .el-month-table tr td.disabled.today .cell{
color: #C0C4CC !important;
}
.monthtime .el-month-table td.today .cell {
font-weight: normal;
}
.monthtime .el-month-table td.today .cell {
color: #606266;
}
</style>

效果展示图:

默认是显示当前月,既【三月】是高亮的,选择【四月】的后,四月文本显示高亮。

elementUI实现日期框选中项文本高亮的更多相关文章

  1. MVC中导航菜单,选中项的高亮问题。

      这个菜单是放在母板页的.比如当前选中的是异常业务监控.如果页面刷新了.就会变成第一张图..选择其他的选项也会,因为页面会刷新嘛.. 怎么处理这个问题了? 答案是记录当前页面的url. 有两种解决思 ...

  2. MVC中导航菜单,选中项的高亮问题。。

    先上图:             这个菜单是放在母板页的.比如当前选中的是异常业务监控.如果页面刷新了.就会变成第一张图..选择其他的选项也会,因为页面会刷新嘛.. 怎么处理这个问题了? 答案是记录当 ...

  3. 项目element-ui checkbox里面获取选中项 实现批量删除 修改

    <el-table :data="tableData" stripe border style="width: 100%" @selection-chan ...

  4. jquery获取select多选框选中的文本值

    $("#select option:selected").text();

  5. jquery获取选中的文本和值

    jquery获取选中的文本和值 1.说明 (1)获取select下拉框选中的索引       $("#selection").get(0).selectedIndex; (2)获取 ...

  6. jquery操作select下拉框的各种方法,获取选中项的值或文本,根据指定的值或文本选中select的option项等

    简介jquery里对select进行各种操作的方法,如联动.取值.根据值或文本来选中指定的select下拉框指定的option选项,读取select选中项的值和文本等. 这一章,站长总结一下jquer ...

  7. 【vue系列】elementUI 穿梭框右侧获取当前选中项的值的思路

    最近 做了一个需求 在查询结果的表格中,选取(可多选)一些值,获取到保单号后,打开一个elementUI的穿梭框,然后获取到所有业务员,选取一些业务员后,将上一步获取到的保单号传递给业务员. 画个示意 ...

  8. jquery 获取一组元素的选中项 - 函数、jquery获取复选框值、jquery获取单选按钮值

    做表单提交时,如果现在还在用form提交,用户体验很差,所以一般使用ajax提交. 其中需要获取每个表单输入元素的值,获取的时候像文本框这些还好说,Jquery提供了 .val() 方法,获取很方便, ...

  9. Js获取下拉框选定项的值和文本

    Js获取下拉框的值和文本网上提供了2种方法:但有些人很不负责任,他们根本没考虑到浏览器之间的差异导致的错误,导致很多新手琢磨了半天找不出错误! 下面我总结下Firefox和IE下获取下拉框选定项的值和 ...

随机推荐

  1. k8s二进制部署 - flannel安装

    安装Flannel [root@hdss7-21 ~]# cd /opt/src/ [root@hdss7-21 src]# wget https://github.com/coreos/flanne ...

  2. Zabbix 触发器配置多监控项阈值

    配置内存自定义监控项 # 监控内存命令 [root@web01 ~]# free -m|awk '/^Mem/{print $NF/$2}' 0.664609 [root@web01 ~]# free ...

  3. Shell 编程练习

    将后缀名为 .txt 的文件改成 .log [root@k8s-master test]# touch localhost_2020-01-{02..26}.txt [root@k8s-master ...

  4. leetcode 39 dfs leetcode 40 dfs

    leetcode 39 先排序,然后dfs 注意先整全局变量可以减少空间利用 class Solution { vector<vector<int>>ret; vector&l ...

  5. Leetcode(106)-从中序与后序遍历序列构造二叉树

    根据一棵树的中序遍历与后序遍历构造二叉树. 注意:你可以假设树中没有重复的元素. 例如,给出 中序遍历 inorder = [9,3,15,20,7] 后序遍历 postorder = [9,15,7 ...

  6. js Array.from & Array.of All In One

    js Array.from & Array.of All In One 数组生成器 Array.from The Array.from() static method creates a ne ...

  7. SSL/TLS All In One

    SSL/TLS All In One HTTPS SSL/TLS 的工作原理 https://www.websecurity.digicert.com/zh/cn/security-topics/ho ...

  8. switchable css dark theme in js & html custom element

    switchable css dark theme in js & html custom element dark theme / dark mode https://codepen.io/ ...

  9. clisp的一些function

    ;; example: (write (A-Z :start (+ 65 1) :end 87)) (defmacro A-Z (&key (start 65) (end 90)) (let* ...

  10. CPU使用率原理及计算方式

    本文转载自CPU使用率原理及计算方式 CPU:超线程和多核 超线程(Hyper-Threading ) 超线程是Intel最早提出一项技术,最早出现在2002年的Pentium4上.单个采用超线程的C ...