![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/eed1a73627eacfdf5d0f356fbebbace2.png#pic_center)
<el-tree
v-if="openPanel"
ref="Vtree"
style="height: 610px"
:data="treeData"
highlight-current
class="filter-tree"
node-key="id"
:default-expanded-keys="[tree_default_check]"
:default-checked-keys="[tree_default_check]"
:accordion="true"
@node-click="handleNodeClick">
<span slot-scope="{ node, data }">
<i :class="icons[data.type]" />
<span style="margin-left:5px;" :title="data.name">{{ data.name }}</span>
</span>
</el-tree>
data(){
icons:{
category:'categoryTreeIcons',
table:'tableIcon',
class:'classIcon'
},
}
CSS
.archives-classification .classIcon{background: url("../../icons/class.png") center no-repeat;padding: 1px 8px !important;}
.archives-classification .categoryTreeIcons{background: url("../../icons/category.png") center no-repeat;padding: 1px 8px !important;}
.archives-classification .tableIcon{background: url("../../icons/table.png") center no-repeat;padding: 1px 8px !important;}