el-cascader宽度
时间: 2023-08-19 19:04:26 浏览: 211
el-cascader组件的宽度可以通过设置最大宽度来限制其自由延伸。可以在样式中添加以下代码来设置最大宽度:
.el-cascader-node {
max-width: 250px;
} \[1\]
另外,可以通过以下样式代码来控制el-cascader组件的宽度:
.el-cascader-menu {
max-width: 680px !important;
}
.el-tooltip__popper.is-light {
width: 600px !important;
} \[2\]
还可以使用以下样式代码来设置el-cascader组件的宽度:
.el-cascader {
width: 100%;
}
.gy-cascader {
max-width: 500px;
overflow-x: auto;
/* 滚动条样式 */
&::-webkit-scrollbar-track-piece {
background-color: #f8f8f800;
}
&::-webkit-scrollbar {
transition: all 2s;
height: 6px;
}
&::-webkit-scrollbar-thumb {
background-color: #ebeaef;
border-radius: 10px;
}
&::-webkit-scrollbar-thumb:hover {
background-color: #bbb;
}
&::-webkit-scrollbar-track {
background: #ffffff;
border-radius: 10px;
}
&::-webkit-scrollbar-corner {
background-color: rgba(255, 255, 255, 0);
}
} \[3\]
通过以上样式设置,可以控制el-cascader组件的宽度。
#### 引用[.reference_title]
- *1* [element里面的el-cascader组件宽度限制](https://blog.csdn.net/qq_44473483/article/details/124690587)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [element级联选择器el-cascader控制宽度,并且文字过长移入鼠标显示文字内容](https://blog.csdn.net/flyingLF/article/details/122171094)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [el-cascader宽度限制,超出显示滚动条](https://blog.csdn.net/Guoyu1_/article/details/129158723)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文