The label content in the elementUI-Select selector is too long, set the width of the pop-up layer

Today, a test classmate found a bug, as shown in the figure below:

The previous test data did not specify the length of words, which caused the test students to input wildly during the test period. Although there was a limit of 30 characters in the later stage, the previous data was not cleaned up, and it looked extremely unsightly.

The first is to think of the operation style, but the addition does not take effect:

::v-deep .el-select-dropdown{
  max-width: 250px;
}

Go through the document, el-select provides an attribute

It happened to be the same as my problem, because this select was written in the p tag by a former colleague, decisively added ::popper-append-to-body="false" to the select, and it was perfectly done!

Summarize

::v-deep .el-select-dropdown{
  max-width: 250px;
}
  <el-select v-model="..." :popper-append-to-body="false">
     <el-option></el-option>
  </el-select>

Guess you like

Origin blog.csdn.net/m0_58481462/article/details/126407067