在这里插入图片描述

        <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 }">
          //  type是节点类型,包含在treeData数据中,用于匹配每个Vnode显示哪种图标
            <i :class="icons[data.type]" />
            <span style="margin-left:5px;" :title="data.name">{{ data.name }}</span>
          </span>
          </el-tree>
element
A Vue.js 2.0 UI Toolkit for Web
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;}
GitHub 加速计划 / eleme / element
10
1
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:5 个月前 )
c345bb45 9 个月前
a07f3a59 * Update transition.md * Update table.md * Update transition.md * Update table.md * Update transition.md * Update table.md * Update table.md * Update transition.md * Update popover.md 9 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐