feat: theme local storage
This commit is contained in:
parent
d91c735b2d
commit
8358f5fcfb
2 changed files with 5 additions and 0 deletions
|
|
@ -68,9 +68,11 @@ watch(
|
|||
if ($q.dark.isActive) {
|
||||
themeMode.value[1].isActive = true;
|
||||
themeMode.value[0].isActive = false;
|
||||
localStorage.setItem('currentTheme', 'dark');
|
||||
} else {
|
||||
themeMode.value[0].isActive = true;
|
||||
themeMode.value[1].isActive = false;
|
||||
localStorage.setItem('currentTheme', 'light');
|
||||
}
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -149,6 +149,9 @@ onMounted(async () => {
|
|||
setLocale('th');
|
||||
}
|
||||
|
||||
const getCurTheme = localStorage.getItem('currentTheme');
|
||||
if (getCurTheme === 'dark') $q.dark.toggle();
|
||||
|
||||
const resultOption = await fetch('/option/option.json');
|
||||
rawOption.value = await resultOption.json();
|
||||
if (locale.value === 'en-US') optionStore.globalOption = rawOption.value.eng;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue