1π
β
You canβt dynamically update the initial theme object used by createVuetify
but you can instead have your updateColor()
method directly modify $vuetify.theme
where the theme colors are made accessible as noted in the documentation
values will also be made available on the instance $vuetify object under the theme property. This allows you to dynamically modify your theme. Behind the scenes, Vuetify will regenerate and update your theme classes, seamlessly updating your application.
// Light theme
this.$vuetify.theme.themes.light.primary = β#4caf50β
// Dark theme
this.$vuetify.theme.themes.dark.primary = β#4caf50β
In your case, the method would look something like this:
updateColor() {
this.$vuetify.theme.themes.light.primary = this.btn_color
}
π€yoduh
Source:stackexchange.com