{ 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. Gym 101480I Ice Igloos(思维乱搞)题解

    题意:给个最多500 * 500的平面,有半径最多不为1的n个圆,现在给你1e5条线段,问你每条线段和几个圆相交,时限10s 思路: 因为半径<1,那么我其实搜索的范围只要在线段附近就好了.x1 ...

  2. js array flat all in one

    js array flat all in one array flat flatMap flatMap > flat + map https://developer.mozilla.org/en ...

  3. javascript nested object merge

    javascript nested object merge deep copy Object reference type function namespace(oNamespace, sPacka ...

  4. Firewall & Network Security

    Firewall & Network Security 防火墙 & 网络安全 NAT Gateway VPC Virtual Private Cloud refs https://en ...

  5. convert number or string to ASCII in js

    convert number or string to ASCII in js ASCII dictionary generator // const dict = `abcdefghijklmnop ...

  6. js spider

    js spider https://gist.github.com/xgqfrms-GitHub/0bf82ff06037a0d1776c9f30033cbfd1 https://www.cnblog ...

  7. website text select notes menu

    website text select notes menu website 文字选择笔记菜单(下划线, 标记, 复制, 分享) 下划线, 标记 https://time.geekbang.org/ ...

  8. how to overwrite css !important style

    how to overwrite css !important style css !important bug how to override css !important style https: ...

  9. dynamic creat svg in js

    dynamic creat svg in js SVG title https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title < ...

  10. 以代码为剑、数学为犁,SPC构建NGK算力生态体系

    人类创造工具,工具反过来也改变着人类.以区块链为核心的货币革命率先吹响了对金融世界重塑的号角.以代码为剑.数学为犁,区块链构建了新的网路信任体系,这是一切的开始.基于此,NGK区块链技术将赋能实体产业 ...