Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
194 views
in Technique[技术] by (71.8m points)

el-date-picker的css修改

现在使用日期选择框,只想要下面的日不想要上面的年月怎么做
图片.png
在火狐的css调试上加一个display:none就可以了,但是在代码中用穿透和伪元素都无法实现

.myDatePicker>>>.el-date-picker__header::before {
        display: none !important;
    }
    
    .myDatePicker>>>.el-date-picker__header {
        display: none !important;
    }

这应该再怎么修改


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
<el-date-picker
  popper-class="hide_header"
  type="date"
  v-model="value"
 ></el-date-picker>

在你原来的style下面新加下面的

<style lang="less" scoped>
...
</style>
<style>
  .hide_header .el-date-picker__header{
    display: none !important;
  }
</style>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...