Skip to content

Commit

Permalink
keep darkmode in new tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0nox committed Apr 9, 2024
1 parent 1183c9e commit dc36776
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions UncertaintySourceArchive/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
import { RouterView } from 'vue-router'
import ContainerComponent from './components/ContainerComponent.vue'
import NavBar from './components/NavBar.vue'
import { provide, ref } from 'vue'
import { provide, ref, watch } from 'vue'
const dark = ref(false)
const dark = ref(localStorage.getItem('dark') == 'true')
provide('dark', dark)
watch(dark, () => {
localStorage.setItem('dark', dark.value ? 'true' : 'false')
})
</script>

0 comments on commit dc36776

Please sign in to comment.