Skip to content

Commit 338e225

Browse files
committed
docs(VTreeview): dedicated example for item-registration
1 parent 901061b commit 338e225

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<template>
2+
<v-sheet class="overflow-y-auto" max-height="300">
3+
<v-treeview
4+
:items="items"
5+
items-registration="props"
6+
open-on-click
7+
></v-treeview>
8+
</v-sheet>
9+
</template>
10+
11+
<script setup>
12+
const items = Array.from({ length: 5 })
13+
.map((_, i) => ({
14+
id: i,
15+
title: `Example item #${i} with 200 children`,
16+
children: Array.from({ length: 200 })
17+
.map((_, ci) => ({
18+
id: `${i}-${ci}`,
19+
title: `Example child item #${i}-${ci}`,
20+
})),
21+
}))
22+
</script>
23+
24+
<script>
25+
export default {
26+
data: () => ({
27+
items: Array.from({ length: 100 })
28+
.map((_, i) => ({
29+
id: i,
30+
title: `Example item ${i}`,
31+
children: Array.from({ length: 100 })
32+
.map((_, ci) => ({
33+
id: `${i}-${ci}`,
34+
title: `Example child item ${ci}`,
35+
})),
36+
})),
37+
}),
38+
}
39+
</script>

packages/docs/src/pages/en/components/treeview.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,18 @@ You can control the text and background color of the active treeview node.
6868

6969
<ExamplesExample file="v-treeview/prop-color" />
7070

71-
#### Dense mode
71+
#### Density
7272

7373
Dense mode provides more compact layout with decreased heights of the items.
7474

7575
<ExamplesExample file="v-treeview/prop-dense" />
7676

77+
#### Items registration
78+
79+
When working with large trees it is recommended to include `items-registration="props"` to ensure faster loading and interactions.
80+
81+
<ExamplesExample file="v-treeview/prop-items-registration" />
82+
7783
<!-- #### Hoverable
7884
7985
Treeview nodes can have a hover effect.

0 commit comments

Comments
 (0)