Original link: el-date-picker width overflow browser problem
Origin of the problem
<el-date-picker
v-model="Time" type="datetimerange"
range-separator="至"
start-placeholder="年/月/日 时:分:秒"
end-placeholder="年/月/日 时:分:秒"
format="YYYY/MM/DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss" />
As can be seen from the figure above, el-date-picker
it exceeds the width of the browser, resulting in a scroll bar.
Solution
Use the properties of the component itself popper-class
to add custom ones class
.
<el-date-picker
v-model="Time" type="datetimerange"
range-separator="至"
start-placeholder="年/月/日 时:分:秒"
end-placeholder="年/月/日 时:分:秒"
format="YYYY/MM/DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
popper-class="tzy-popper" />
.tzy-popper{
margin-left: -55px;
}