el-date-picker手动调整弹窗(时间日期选中器)的位置

3,826 阅读1分钟

1.添加前两个属性标签(主要)

<el-date-picker 
        :append-to-body="false"
        popper-class="tab04f1-date-picker"
        v-model="timedate"
        type="datetimerange"
        value-format="timestamp"
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期">
</el-date-picker>

2. 在style里添加

.el-date-editor{
  position: relative;
}
::v-deep .tab04f1-date-picker{
  position: absolute!important;
  right:0!important;
  top:108px!important;
}

通过 right或left调整左右,top调距离高度