Dynamically change the selected theme #16381
Unanswered
Michael2109
asked this question in
Q&A
Replies: 3 comments 1 reply
-
Should do the trick. |
Beta Was this translation helpful? Give feedback.
0 replies
-
If you are using a store, you could just bind the theme prop in <template>
<AuthProvider>
<VApp :theme="currentTheme">
<GAppBar />
<router-view />
<GSnackbar />
</VApp>
</AuthProvider>
</template>
<script setup>
// 👉 pinia appStore.currentTheme is persisted.
// 👉 currentTheme values are light / dark
// 👉 toRefs is needed so reactivity continues in destructure.
const { currentTheme } = toRefs(useAppStore())
</script> |
Beta Was this translation helpful? Give feedback.
1 reply
-
You store the them, and just use it with theme-provider.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to change the theme after a user clicks a button.
To do so I create 2 themes.
I then update it using
I thought I had this working fine but it appears not. I can't find anything in the documentation specifying how to do this for Vuetify 3.
How can I dynamically change the selected theme?
Beta Was this translation helpful? Give feedback.
All reactions