<template>
  <div class='custom-tree-node'>
    <i v-if="data.children && data.children.length > 0" class="el-icon-folder"></i>
    <i v-else class="el-icon-document-copy"></i>
    <span style="padding-left: 6px">
      <span v-if="groupName">{{ data[groupName] }}/</span>
      {{ data[defaultProps.label] }}
    </span>
  </div>
</template>

<script>
export default {
  name: "CmsFormSelectTreeRender",
  props: {
    data: {
      type: Object,
      default: {}
    },
    groupName: String,
    defaultProps: {
      type: Object,
      default: () => {
        return {
          value: 'id', // ID字段名
          label: 'name', // 显示名称
          children: 'children' // 子级字段名
        }
      }
    }
  }
}
</script>

<style scoped>

</style>