Skip to content

208 - 树组件 #1940

Open
Open
@qingqunzhi

Description

@qingqunzhi
<script setup lang="ts">
interface TreeData {
  key: string;
  title: string;
  children: TreeData[];
}
const { data } = defineProps<{ data: TreeData[] }>();
</script>

<template>
  <ul>
    <li v-for="t in data" :key="t.key">
      {{ t.title }}
      <TreeComponent
        v-if="t.children && t.children.length > 0"
        :data="t.children"
      />
    </li>
  </ul>
</template>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions