1、标签组件:
<el-cascader ref="cascaderRef1" popper-class="popper-cascader" @change="handleChangeCascader(cascaderRef1)"></el-cascader>
2、给popper-cascader设置样式,在element-ui,scss里编写
.popper-cascader .el-cascader-panel .el-radio {
width: 100%;
height: 100%;
z-index: 10;
position: absolute;
top: 0px;
right: 0px;
}
.popper-cascader .el-cascader-panel .el-checkbox {
width: 100%;
height: 100%;
z-index: 10;
position: absolute;
top: 0px;
right: 0px;
}
.popper-cascader .el-cascader-panel .el-radio__input {
display: none;
}
.popper-cascader .el-cascader-panel .el-checkbox__input {
margin-top: 2px;
margin-left: 8px;
}
.popper-cascader .el-cascader-panel .el-cascader-node__postfix {
top: 10px;
}
3、获取el-cascader的 ref const cascaderRef1 = ref(); 4、获取el-cascader的change事件去关闭下拉选项 function handleChangeCascader(type){ type.togglePopperVisible(false); }; 标签:el,top,单选,cascader,popper,0px,panel From: https://www.cnblogs.com/clbStudy/p/18186695