element-ui中用el-tree垂直滚动条不展示
原创1.element-ui中使用el-tree不显示水平滚动条
::v-deep .el-tree-node :nth-child(2) {
padding: 1px;
overflow: visible;
}
2.给树el-tree在名称后添加注释
setUserstreeData: {
id: "10363048910990",
name: "dcsfzfvsdzf有限公司",
progress: "1",
child: [
{
id: "13539157974",
name: "sdavgzsdfgvdsfv有限公司",
child: null,
progress: "0",
},
{
id: "1353981813010",
name: "dsavfgdsfdzsz术研究院",
progress: "0",
child: [
{
id: "13688129090",
name: "dfhsgfdgsdfgdf有限公司",
progress: null,
child: [
{
id: "1369024725506",
name: "sfgdfgdfg单位",
child: null,
progress: null,
},
{
id: "13694267522",
name: "gggggg单位",
child: null,
progress: null,
},
],
},
{
id: "136882545",
name: "ggngjjjjgfghfdg分公司",
child: null,
progress: null,
},
],
},
{
id: "135399959042",
name: "aaaaaa有限公司",
progress: "0",
child: [
{
id: "135398311516161",
name: "aaaddsssssss公司",
child: null,
progress: null,
},
],
},
],
},
this.getTreeName(this.setUserstreeData);
// 查找选定的项目单位id对应的二次单元
getTreeName(list) {
let _this = this;
list.forEach((item, index) => {
let a = item;
if (index < list.length) {
let mark = "";
if (a.progress == "2") {
mark = "(已完成)";
} else if (a.progress == "0" || a.progress == "1") {
mark = "(未完成)";
}
a.name = a.name + mark + "";
}
if (a.child && a.child.length > 0) {
console.log("a.child", a.child);
if (a.child && a.child.length > 0) {
_this.getTreeName(a.child);
}
}
});
return;
},
版权声明
所有资源都来源于爬虫采集,如有侵权请联系我们,我们将立即删除