el-tree懒加载时的箭头隐藏
<el-tree class='tree-padding' :data="api_management_case_tree" ref="tree" show-checkbox :highlight-current="true" node-key="id" :default-expand-all="false" :load="loadNode" :expand-on-click-node="false" lazy :default-expanded-keys="[]" :default-checked-keys="[defaultCase]" :props="defaultProps" > </el-tree>
解决方式:
loadNode(node, resolve) { if (node.level == 0) { console.log(node.level) } if (node.level > 4) { return resolve([]); } if (node.level >= 1 && node.level <=3) { let req = { "parent":node.data.id, "isLeaf": 'false' } postApiManagementTreeRequest(req).then(data => { if (true === data.data.success){ this.resolve = data.data.data return resolve(data.data.data); }else { this.$message.error(data.data.message) } }) } if (node.level == 4) { let req = { "parent":node.data.id } postApiScenariosCaseRequest(req).then(data => { if (true === data.data.success){ data.data.data.forEach(item=>{ if(true === item.isParent){ item.isLeaf = true } }) return resolve(data.data.data) }else { this.$message.error(data.data.message) } }) } },