66 <p class =" d-inline-block title" >Web Activity Time Tracker</p >
77 </div >
88 <div class =" settings-tab" >
9- <input type =" radio" id =" general-tab" name =" settings-group" checked />
9+ <input
10+ type =" radio"
11+ id =" general-tab"
12+ name =" settings-group"
13+ checked
14+ v-on:change =" selectTab(SettingsTab.GeneralSettings)"
15+ />
1016 <label name =" tabName" for =" general-tab" >General Settings</label >
1117
1218 <div class =" settings-content" >
13- <GeneralSettings />
19+ <GeneralSettings v-if = " selectedTab == SettingsTab.GeneralSettings " />
1420 </div >
1521 </div >
1622
1723 <div class =" settings-tab" >
18- <input type =" radio" id =" white-list-tab" name =" settings-group" />
24+ <input
25+ type =" radio"
26+ id =" white-list-tab"
27+ name =" settings-group"
28+ v-on:change =" selectTab(SettingsTab.WhiteList)"
29+ />
1930 <label name =" tabName" for =" white-list-tab" >White List</label >
2031
2132 <div class =" settings-content" >
22- <WhiteList />
33+ <WhiteList v-if = " selectedTab == SettingsTab.WhiteList " />
2334 </div >
2435 </div >
2536
2637 <div class =" settings-tab" >
27- <input type =" radio" id =" limits-tab" name =" settings-group" />
38+ <input
39+ type =" radio"
40+ id =" limits-tab"
41+ name =" settings-group"
42+ v-on:change =" selectTab(SettingsTab.Limits)"
43+ />
2844 <label name =" tabName" for =" limits-tab" >Limits</label >
2945
3046 <div class =" settings-content" >
31- <Limits />
47+ <Limits v-if = " selectedTab == SettingsTab.Limits " />
3248 </div >
3349 </div >
3450 <div class =" settings-tab" >
35- <input type =" radio" id =" notification-tab" name =" settings-group" />
51+ <input
52+ type =" radio"
53+ id =" notification-tab"
54+ name =" settings-group"
55+ v-on:change =" selectTab(SettingsTab.Notifications)"
56+ />
3657 <label name =" tabName" for =" notification-tab" >Notifications</label >
3758
3859 <div class =" settings-content" >
39- <Notifications />
60+ <Notifications v-if = " selectedTab == SettingsTab.Notifications " />
4061 </div >
4162 </div >
4263
4364 <div class =" settings-tab" >
44- <input type =" radio" id =" about-tab" name =" settings-group" />
65+ <input
66+ type =" radio"
67+ id =" about-tab"
68+ name =" settings-group"
69+ v-on:change =" selectTab(SettingsTab.About)"
70+ />
4571 <label name =" tabName" for =" about-tab" >About</label >
4672
4773 <div class =" settings-content" >
48- <About />
74+ <About v-if = " selectedTab == SettingsTab.About " />
4975 </div >
5076 </div >
5177 </div >
@@ -56,8 +82,15 @@ import { onMounted, ref } from 'vue';
5682import GeneralSettings from ' ../components/GeneralSettings.vue' ;
5783import WhiteList from ' ../components/WhiteList.vue' ;
5884import About from ' ../components/About.vue' ;
85+ import { SettingsTab } from ' ../utils/enums' ;
5986
60- onMounted (async () => {});
87+ const selectedTab = ref <SettingsTab >();
88+
89+ onMounted (() => (selectedTab .value = SettingsTab .GeneralSettings ));
90+
91+ function selectTab(value : SettingsTab ) {
92+ selectedTab .value = value ;
93+ }
6194 </script >
6295
6396<style scoped>
0 commit comments