<el-tree :data="data" :props="defaultProps" ref="treeRef" show-checkbox @check-change="handleCheckChange"><!-- 自定义节点内容 --><template #default="{ node, data, store }"><span class="tree-node-content"><!-- 黄色五角星 --><span v-if="node.level != 1" class="yellow-star" @click="handleStarClick(node)"><el-icon><Star /></el-icon></span><!-- 节点文本 --><span class="node-label">{{ node.label }}</span><span v-if="node.level != 1"style="width: 10px;height: 10px;background: red;border-radius: 50%;margin-left: 18px;"></span></span></template></el-tree>
效果图