-
-
Notifications
You must be signed in to change notification settings - Fork 189
/
Copy pathApp.vue
43 lines (42 loc) · 784 Bytes
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<script setup lang="ts">
import { ref } from "vue"
import TreeComponent from "./TreeComponent.vue"
const treeData = ref([{
key: '1',
title: 'Parent 1',
children: [{
key: '1-1',
title: 'child 1',
}, {
key: '1-2',
title: 'child 2',
children: [{
key: '1-2-1',
title: 'grandchild 1',
}, {
key: '1-2-2',
title: 'grandchild 2',
},]
},]
}, {
key: '2',
title: 'Parent 2',
children: [{
key: '2-1',
title: 'child 1',
children: [{
key: '2-1-1',
title: 'grandchild 1',
}, {
key: '2-1-2',
title: 'grandchild 2',
},]
}, {
key: '2-2',
title: 'child 2',
},]
}])
</script>
<template>
<TreeComponent :data="treeData" />
</template>