在Element UI中使用级联选择器,并且设置可以选择任意一级的内容
v-model="selectedKeys" :options="options" :expand-trigger="'hover'" style="width:100%" @change="change" clearable :props="{ checkStrictly: true }">
解决方案:
当加入checkStrictly后就会出现单选框的问题,修改样式即可;这里使用的less语法,需要有less依赖,加入样式后如果没有生效,可以放在App.vue中的样式下
.el-cascader-panel .el-radio {
width: 100%;
height: 100%;
z-index: 10;
position: absolute;
top: 10px;
right: 10px;
}
.el-cascader-panel .el-radio__input {
visibility: hidden;
}
.el-cascader-panel .el-cascader-node__postfix {
top: 10px;
}
推荐文章
发表评论