<template>
  <div>
    <div class="treebox-content">
      <el-tree
        v-if="treeData"
        ref="tree"
        node-key="value"
        :data="treeData"
        :check-strictly="true"
        :check-on-click-node="true"
        :expand-on-click-node="false"
        :default-expanded-keys="defaultExpandedKeys"
        :current-node-key="currentNodeKey"
        @check-change="nodeClick"
        :highlight-current="true"
      >
        <span class="custom-tree-node" slot-scope="{ node, data }">
          <span v-if="data.icon" style="margin-right:10px;"><i :class="data.icon"/></span>
          <span>{{ node.label }}</span>
        </span>
      </el-tree>
    </div>
  </div>
</template>

<script>
export default {
  name: 'orgtree',
  props: {
    value: { required: true },
    treeData: { dafault: null },
    defaultExpandedKeys:{default:null},
    currentNodeKey:{default:null}
  },
  data() {
    return {}
  },
  computed: {},
  methods: {
    nodeClick(data) {
      this.$emit('input', data.id)
    }
  },
  mounted() {},
  watch: {}
}
</script>
