Skip to content

Commit

Permalink
Updating Vuetify decorator example
Browse files Browse the repository at this point in the history
The Vuetify decorator example was expecting that the labels from the theme switcher would exactly match the vuetify theme keys from the vuetifyOptions.  This change makes that association more explicit while also allowing the display labels to be different from the Vuetify theme keys.
  • Loading branch information
justingish authored and yannbf committed Apr 19, 2024
1 parent 67a2111 commit 2f71566
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions code/addons/themes/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const withVuetifyTheme = ({ themes, defaultTheme }) => {
setup() {
const theme = useTheme();

theme.global.name.value = selected;
theme.global.name.value = themes[selected];

return {
theme,
Expand Down Expand Up @@ -195,12 +195,13 @@ setup((app) => {

export const decorators = [
withVuetifyTheme({
// These keys are the labels that will be displayed in the toolbar theme switcher
// The values must match the theme keys from your VuetifyOptions
themes: {
light: 'light',
dark: 'dark',
customTheme: 'myCustomTheme',
'high contrast': 'highContrast',
},
defaultTheme: 'customTheme', // The key of your default theme
defaultTheme: 'light', // The key of your default theme
}),
];
```
];```

0 comments on commit 2f71566

Please sign in to comment.