elementui-樹形控件實現(xiàn)子節(jié)點右側添加圖標和數(shù)據(jù)鼠標放上去顯示文字效果
更新時間:2024年01月16日 10:41:03 作者:hat-ing
這篇文章主要介紹了elementui-樹形控件實現(xiàn)子節(jié)點右側添加圖標和數(shù)據(jù)鼠標放上去顯示文字效果,本文結合實例代碼給大家介紹的非常詳細,感興趣的朋友一起看看吧
1、代碼
<el-tree v-loading="nameLoding" :data="data" node-key="id" :highlight-current="true" empty-text="暫無數(shù)據(jù)" :props="defaultPropsIndex" default-expand-all :filter-node-method="filterNodeIndex" ref="treeName" @node-click="getCheckedNodes" > <span class="custom-tree-node" slot-scope="{ node, data }" > <span>{{ node.label }}</span> <span v-if="node.level > 1"> <span style=" text-align: left; width: 63px; display: inline-block; " > <el-tooltip class="item" effect="dark" content="擁有的指標權限個數(shù)" placement="top" > <i title="" class="el-icon-s-marketing" style="color: rgb(103, 194, 58)" ></i> </el-tooltip ><span style="margin-right: 10%">{{ data.num }}</span></span > <span style=" text-align: left; width: 71px; display: inline-block; " > <el-tooltip class="item" effect="dark" content="擁有的訪問權限個數(shù)" placement="top" > <i class="el-icon-success" style="color: rgb(103, 194, 58)" ></i> </el-tooltip ><span style="margin-right: 10%">{{ data.sub_num }}</span> </span> </span> </span> </el-tree>
css
.custom-tree-node { flex: 1; display: flex; align-items: center; justify-content: space-between; font-size: 14px; /* padding-right: 8px; */ /* padding-right: 15%; */ }
效果圖:
到此這篇關于elementui-樹形控件實現(xiàn)子節(jié)點右側添加圖標和數(shù)據(jù),鼠標放上去顯示文字的文章就介紹到這了,更多相關elementui樹形控件子節(jié)點右側添加圖標內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!