Przeglądaj źródła

机构树组件

jiawuxian 2 lat temu
rodzic
commit
3c7590c370
1 zmienionych plików z 14 dodań i 13 usunięć
  1. 14 13
      src/components/orgTree/index.vue

+ 14 - 13
src/components/orgTree/index.vue

@@ -28,8 +28,8 @@
         :default-checked-keys="defaultKeys"
         @node-click="handleNodeClick"
         v-bind="$attrs"
-      >    
-    </el-tree>
+      >
+      </el-tree>
     </div>
   </div>
 </template>
@@ -60,9 +60,11 @@ export default {
     },
     defaultProps: {
       type: Object,
-      default: {
-        children: "children",
-        label: "shortName",
+      default: () => {
+        return {
+          children: "children",
+          label: "shortName",
+        };
       },
     },
     customRequest: {
@@ -107,7 +109,7 @@ export default {
         this.treeList = response.data;
         this.defaultKeys.push(response.data[0].id);
         this.$emit("defaultKey", response.data[0].id);
-        this.$emit('defaultOrg',response.data[0]);
+        this.$emit("defaultOrg", response.data[0]);
         this.defaultKey = response.data[0].id;
         setTimeout(() => {
           this.$refs.tree.setCurrentKey(response.data[0].id);
@@ -127,12 +129,11 @@ export default {
 };
 </script>
 
-<style lang='scss' scoped>
-  .el-tree-ex {
-    overflow: auto;
-    ::v-deep .is-current > .el-tree-node__content {
-      background-color: #d1e0f1 !important;
-    }
+<style lang="scss" scoped>
+.el-tree-ex {
+  overflow: auto;
+  ::v-deep .is-current > .el-tree-node__content {
+    background-color: #d1e0f1 !important;
   }
-
+}
 </style>