|
1 | 1 | <template> |
2 | | - <div> |
3 | | - <h2>Hello from Vue</h2> |
4 | | - <p>{{ message }}</p> |
5 | | - </div> |
| 2 | + <aside class="sidebar"> |
| 3 | + <div class="sidebar__top"> |
| 4 | + <SidebarLogo /> |
| 5 | + |
| 6 | + <nav class="sidebar__nav"> |
| 7 | + <SidebarNavSection |
| 8 | + v-for="section in sections" |
| 9 | + :key="section.id" |
| 10 | + v-bind="section" |
| 11 | + /> |
| 12 | + </nav> |
| 13 | + </div> |
| 14 | + |
| 15 | + <SidebarCapacityCard class="sidebar__bottom" /> |
| 16 | + </aside> |
6 | 17 | </template> |
7 | 18 |
|
8 | | -<script> |
9 | | -export default { |
10 | | - name: 'App', |
11 | | - data() { |
12 | | - return { |
13 | | - message: 'This is a reusable component!' |
14 | | - } |
| 19 | +<script setup> |
| 20 | +import SidebarLogo from './SidebarLogo.vue' |
| 21 | +import SidebarNavSection from './SidebarNavSection.vue' |
| 22 | +import SidebarCapacityCard from './SidebarCapacityCard.vue' |
| 23 | +
|
| 24 | +const sections = [ |
| 25 | + { |
| 26 | + id: 'general', |
| 27 | + label: 'General', |
| 28 | + items: [ |
| 29 | + { label: 'Dashboard', icon: 'grid', route: '/dashboard', badge: null }, |
| 30 | + { label: 'Subscribers', icon: 'users', route: '/subscribers' }, |
| 31 | + { label: 'Lists & Segments', icon: 'list', route: '/lists' }, |
| 32 | + ], |
| 33 | + }, |
| 34 | + { |
| 35 | + id: 'marketing', |
| 36 | + label: 'Marketing', |
| 37 | + items: [ |
| 38 | + { label: 'Campaigns', icon: 'paper-plane', route: '/campaigns', badge: 3 }, |
| 39 | + { label: 'Templates', icon: 'layout', route: '/templates' }, |
| 40 | + ], |
15 | 41 | }, |
16 | | - created() { |
17 | | - console.log('App component created'); |
| 42 | + { |
| 43 | + id: 'analytics', |
| 44 | + label: 'Analytics', |
| 45 | + items: [ |
| 46 | + { label: 'Bounces & Reports', icon: 'chart-bar', route: '/reports' }, |
| 47 | + ], |
18 | 48 | }, |
19 | | - mounted() { |
20 | | - console.log('App component mounted'); |
| 49 | + { |
| 50 | + id: 'system', |
| 51 | + label: 'System', |
| 52 | + items: [{ label: 'Settings', icon: 'settings', route: '/settings' }], |
21 | 53 | }, |
22 | | - updated() { |
23 | | - console.log('App component updated'); |
24 | | - } |
25 | | -} |
| 54 | +] |
26 | 55 | </script> |
0 commit comments