File tree Expand file tree Collapse file tree 2 files changed +46
-1
lines changed
Expand file tree Collapse file tree 2 files changed +46
-1
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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
7373Dense 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
7985Treeview nodes can have a hover effect.
You can’t perform that action at this time.
0 commit comments