Explorar el Código

feat: 隐藏根节点的删除节点按钮,防止误操作。

hkshu12 hace 5 años
padre
commit
910d58967c
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      src/components/TreeNode.vue

+ 3 - 1
src/components/TreeNode.vue

@@ -15,7 +15,9 @@
       </ElCard>
     </div>
     <div class="node-postfix">
-      <div class="icon" target="delete" @click="deleteNode(id)"></div>
+      <template v-if="depth!==1">
+        <div class="icon" target="delete" @click="deleteNode(id)"></div>
+      </template>
       <template v-if="depth!==4">
         <div class="icon" target="add" @click="addChild(id)"></div>
       </template>