1+ <script setup>
2+ import { AccordionComponent , ItemDirective as Item ,
3+ ItemsDirective as Items , TreeViewComponent
4+ } from ' @syncfusion/ej2-vue-navigations' ;
5+
6+ const treeViewData = [
7+ {
8+ id: ' 01' ,
9+ name: ' Local Disk (C:)' ,
10+ subChild: [
11+ { id: ' 01-01' , name: ' Program Files' },
12+ { id: ' 01-02' , name: ' Users' },
13+ { id: ' 01-03' , name: ' Windows' },
14+ ]
15+ },
16+ {
17+ id: ' 02' ,
18+ name: ' Local Disk (D:)' ,
19+ subChild: [
20+ { id: ' 02-01' , name: ' Personals' },
21+ { id: ' 02-02' , name: ' Projects' },
22+ ]
23+ },
24+ {
25+ id: ' 03' ,
26+ name: ' Local Disk (E:)' ,
27+ icon: ' folder' ,
28+ subChild: [
29+ {
30+ id: ' 03-01' ,
31+ name: ' Pictures' ,
32+ subChild: [
33+ { id: ' 03-01-01' , name: ' Wind.jpg' },
34+ { id: ' 03-01-02' , name: ' Stone.jpg' }
35+ ]
36+ },
37+ {
38+ id: ' 03-02' ,
39+ name: ' Documents' ,
40+ subChild: [
41+ { id: ' 03-02-01' , name: ' Global Warming.ppt' },
42+ { id: ' 03-02-02' , name: ' Social Network.pdf' },
43+ ]
44+ },
45+ {
46+ id: ' 03-03' ,
47+ name: ' Study Materials' ,
48+ subChild: [
49+ { id: ' 03-03-01' , name: ' UI-Guide.pdf' },
50+ { id: ' 03-03-02' , name: ' Tutorials.zip' },
51+ ]
52+ },
53+ ]
54+ }
55+ ];
56+ </script >
57+
58+ <template >
59+ <div style =" height :1080px ; width : 500px ; margin-top : 10% ; margin-left : 30% ;" >
60+ <AccordionComponent expandMode =" Single" >
61+ <Items >
62+ <Item header =" TreeView" :content =" 'treeview'" ></Item >
63+ <template v-slot :treeview >
64+ <TreeViewComponent
65+ :fields =" { dataSource:treeViewData, id:'id', text:'name',
66+ child:'subChild'
67+ }"
68+ ></TreeViewComponent >
69+ </template >
70+ <!-- <Item header="Andrew Fuller" :content="'andrew'"></Item>
71+ <template v-slot:andrew>
72+ <div class="container" id="andrew" style="display:none">
73+ <img src="https://ej2.syncfusion.com/angular/demos/assets/treegrid/images/AndrewFuller.png" alt="Andrew Fuller"/>
74+ <div class="content">
75+ <b>Andrew Fuller</b> Andrew Fuller was born on Friday, 13 March 1987. Now lives in New York City, enjoys hiking, and works as a software developer at a tech startup.
76+ </div>
77+ </div>
78+ </template>
79+ <Item header="Janet Leverling" :content="'janet'"></Item>
80+ <template v-slot:janet>
81+ <div class="container" id="janet" style="display:none">
82+ <img src="https://ej2.syncfusion.com/angular/demos/assets/treegrid/images/JanetLeverling.png" alt="Janet Leverling"/>
83+ <div class="content">
84+ <b>Janet Leverling</b> Janet Leverling was born on Sunday, 22 July 1992. Now lives in San Francisco, loves painting, and is currently working as a marketing manager for a major retail company.
85+ </div>
86+ </div>
87+ </template>
88+ <Item header="Laura Callahan" :content="'laura'"></Item>
89+ <template v-slot:laura>
90+ <div class="container" id="laura"style="display:none">
91+ <img src="https://ej2.syncfusion.com/angular/demos/assets/treegrid/images/LauraCallahan.png" alt="Laura Callahan"/>
92+ <div class="content">
93+ <b>Laura Callahan</b> Laura Callahan was born on Wednesday, 15 May 1985. Now lives in Chicago, enjoys playing the guitar, and works as a financial analyst for an investment firm.
94+ </div>
95+ </div>
96+ </template> -->
97+ </Items >
98+ </AccordionComponent >
99+ </div >
100+ </template >
101+
102+ <style >
103+ @import " ../node_modules/@syncfusion/ej2-base/styles/material.css" ;
104+ @import " ../node_modules/@syncfusion/ej2-buttons/styles/material.css" ;
105+ @import " ../node_modules/@syncfusion/ej2-vue-navigations/styles/material.css" ;
106+
107+ .container {
108+ display : inline-flex ;
109+ width :auto ;
110+ padding :0 ;
111+ }
112+ img {
113+ height :55px ;
114+ width :55px ;
115+ }
116+ .content {
117+ margin-left :10px ;
118+ }
119+ </style >
0 commit comments