File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script setup>
22import {onMounted , ref } from ' vue'
33import {useRoute , useRouter } from ' vue-router'
4+ import {useTheme } from ' vuetify'
45import {useSQLite } from " @/composables/useSQLite.js" ;
6+ import {useThemeStore } from ' @/stores/theme'
57import FileUploaderView from ' @/components/FileUploaderView.vue'
68import CoinListView from " @/components/CoinListView.vue" ;
79import SettingsView from " @/components/SettingsView.vue" ;
@@ -25,7 +27,12 @@ const drawer = ref(false)
2527const router = useRouter ()
2628const route = useRoute ()
2729
30+ const themeStore = useThemeStore ()
31+ const theme = useTheme ()
32+
2833onMounted (async () => {
34+ theme .change (themeStore .currentTheme )
35+
2936 await router .replace (' /' )
3037})
3138
Original file line number Diff line number Diff line change 11<script setup>
22import {onMounted , onUnmounted , ref } from " vue" ;
3+ import { useTheme } from ' vuetify'
34import { useLocaleStore } from ' @/stores/locale'
45import { useThemeStore } from ' @/stores/theme'
56
67const themeStore = useThemeStore ()
78const localeStore = useLocaleStore ()
9+ const appTheme = useTheme ()
810
911const langs = ref ([
1012 {lang: ' bg' , name: ' Български' },
@@ -37,6 +39,11 @@ onMounted(async () => {
3739onUnmounted (async () => {
3840 emit (' update:title' , oldTitle);
3941})
42+
43+ const handleThemeChange = (theme ) => {
44+ themeStore .setTheme (theme)
45+ appTheme .change (theme)
46+ }
4047 </script >
4148
4249<template >
@@ -47,9 +54,10 @@ onUnmounted(async () => {
4754 v-model =" themeStore.currentTheme"
4855 rounded =" xl"
4956 border
57+ @update:model-value =" handleThemeChange"
5058 >
5159 <v-btn value =" dark" icon =" mdi-weather-night" ></v-btn >
52- <v-btn value =" auto " icon =" mdi-brightness-auto" ></v-btn >
60+ <v-btn value =" system " icon =" mdi-brightness-auto" ></v-btn >
5361 <v-btn value =" light" icon =" mdi-weather-sunny" ></v-btn >
5462 </v-btn-toggle >
5563 </v-list-item >
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import { createPinia } from 'pinia'
1010import * as components from 'vuetify/components'
1111import * as directives from 'vuetify/directives'
1212import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
13+ import colors from 'vuetify/util/colors'
14+ import { md3 } from 'vuetify/blueprints'
1315
1416// Components
1517import App from './App.vue'
@@ -21,6 +23,24 @@ pinia.use(piniaPluginPersistedstate)
2123const vuetify = createVuetify ( {
2224 components,
2325 directives,
26+ blueprint : md3 ,
27+ theme : {
28+ defaultTheme : 'dark' ,
29+ themes : {
30+ light : {
31+ dark : false ,
32+ colors : {
33+ primary : colors . orange . lighten1 ,
34+ }
35+ } ,
36+ dark : {
37+ dark : true ,
38+ colors : {
39+ primary : colors . orange . darken2 ,
40+ }
41+ }
42+ }
43+ }
2444} )
2545
2646const app = createApp ( App )
You can’t perform that action at this time.
0 commit comments