修改element日历样式

第一种:需要注意的是popper-class=“timeDate”

在这里插入图片描述

<el-date-picker
  ref="time"
    v-model="today"
    type="date"
    :clearable="false"
    class="inputClass"
    placeholder="选择日期"
    popper-class="timeDate"
    :picker-options="pickerOptions"
    @change="chooseDate"
    @blur="chooseDate"
  />
</div>


<style lang="scss" scoped>>
	//隐藏日期文本框
	.inputClass.el-date-editor.inputClass.el-input.el-input--prefix.el-input--suffix.el-date-editor--date{
   
          opacity: 0 !important;
          cursor: auto;
     }
</style>
	

这个样式需要写在app才有效,这个组件他是跟app平级的,popper-class="timeDate",给他加一个指定的样式,方便修改项目中如果有多个不同的日期组件样式
<style lang="scss">
  .timeDate.el-picker-panel.el-date-picker.el-popper{
   
    top: 565px !important;
    // left: 1609px !important;
    border: none !important;
    box-shadow: none !important;
  }
  .timeDate.el-date-picker{
   
    width: 573px;
  }
  .timeDate.el-date-picker .el-picker-panel__content{
   
    width: 95% !important;
  }

  .timeDate.el-popper .popper__arrow, .el-popper .popper__arrow::after {
   
    display: none !important;
  }
  .el-date-table td.today span {
   
    color: #ff9000;
  }
  .el-date-table td.current:not(.disabled) span {
   
    color: #FFF;
    background-color: #ff9000;
  }
  .el-date-table td.available:hover {
   
    color: #ff9000;
  }
</style>

第二种:

在这里插入图片描述

<div class="calendarLeft">
   <el-calendar ref="calendarBtn" v-model="today" :first-day-of-week="7" class="calendarLit"
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值