elment小结

本文介绍了如何在Vue项目中使用ElementUI的el-date-picker组件进行年度选择,并关注了其高亮显示、颜色设置和自定义样式。特别提到了`.date_form`类中的CSS样式,确保与整体系统风格一致。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 日期选择(年选择后高亮)

 <el-form-item label="年度选择">
        <el-date-picker
          type="year"
          v-model="years"
          value-format="yyyy"
          placeholder="年度选择"
          popper-class="date_form"
          @change="pickerStatus1">
        </el-date-picker>
      </el-form-item>

在这里插入图片描述

其中popper-class是官网的

.date_form {
  .el-year-table td.current:not(.disabled) .cell{
    color: #1890ff;
    font-weight: bold !important;
    background-color: var(--el-datepicker-active-color); // 这里应用的是项目的默认样式颜色,跟整个系统保持统一
    border-radius: 100px;
  }
  .el-year-table td.today .cell {
    font-weight: normal;
    color: #606266;
  }
}

在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值