Cristiano Magro
2025-01-06 eb387dbd90a2a891ee5ee4458e32cccb460fd9b1
commit | author | age
4f1007 1 <template>
CM 2   <div>
3     <the-header></the-header>
4     <!-- <TheHeader /> -->
5     <button @click="setSelectedComponent('active-goals')">Active Goals</button>
6     <button @click="setSelectedComponent('manage-goals')">Manage Goals</button>
7     <!-- <active-goals v-if="selectedComponent === 'active-goals'"></active-goals>
8     <manage-goals v-if="selectedComponent === 'manage-goals'"></manage-goals>-->
9     <keep-alive>
10       <component :is="selectedComponent"></component>
11     </keep-alive>
12   </div>
13 </template>
14
15 <script>
16 import TheHeader from './components/layout/TheHeader.vue';
17 // import BadgeList from './components/BadgeList.vue';
18 // import UserInfo from './components/UserInfo.vue';
19 // import CourseGoals from './components/CourseGoals.vue';
20 import ActiveGoals from './components/ActiveGoals.vue';
21 import ManageGoals from './components/ManageGoals.vue';
22
23 export default {
24   components: {
25     TheHeader,
26     ActiveGoals,
27     ManageGoals,
28   },
29   data() {
30     return {
31       selectedComponent: 'active-goals',
32       activeUser: {
33         name: 'Maximilian Schwarzmüller',
34         description: 'Site owner and admin',
35         role: 'admin',
36       },
37     };
38   },
39   methods: {
40     setSelectedComponent(cmp) {
41       this.selectedComponent = cmp;
42     },
43   },
44 };
45 </script>
46
47 <style>
48 html {
49   font-family: sans-serif;
50 }
51
52 body {
53   margin: 0;
54 }
55 </style>