<script setup lang="ts">
/*
 * 表单组件 选择部门树
 * */
import { getDeptTree } from '../api'
import { ref } from 'vue'

const model = defineModel()
const data = ref([])

const getDeptTreeApi = async () => {
  const res = await getDeptTree()
  data.value = res.data
}
getDeptTreeApi()
</script>

<template>
  <el-tree-select
    v-model="model"
    :data="data"
    :render-after-expand="false"
    check-strictly
    check-on-click-node
    clearable
    :props="{
      label: 'name'
    }"
    node-key="id"
    v-bind="$attrs"
  />
</template>

<style scoped lang="less"></style>
