Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

怎么隐藏掉el-select中的某个节点??

因为一些需求 下拉框需要做成tree形,但是会多出来一个无匹配数据,image.png
image.png
image.png

我想隐藏掉这个无匹配数据,本来的想法是用css: display:none,结果发现这个tree组件居然在最外层,如果使用的话就会改掉整个项目,请问一下这个该怎么解决?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

无匹配数据是Select组件的,设置为空就好了

 <el-select
    no-match-text=""
 >
 </el-select>

方法二:

<el-select
    popper-class="test"
 >
 </el-select>
<style>
    .test .el-select-dropdown__empty{
        display:none;
    }
</style>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...