[Vuejs]-How to get Vuetify to update its colours when you change the theme programatically

0๐Ÿ‘

โœ…

I ended up setting the values directly in the response.

setTheme() {
      const payload = {
        organisation: this.organisation
      };
      setTheme(payload)
        .then(response => {
          const theme = this.$vuetify.theme.themes.light;
          const responseTheme = response.organisation.theme;
          theme.primary = responseTheme.primary_color;
          theme.secondary = responseTheme.secondary_color;
          theme.accent = responseTheme.accent_color;
          theme.error = responseTheme.error_color;
          this.$store.dispatch("SET_THEME", response.data.organisation.theme);
        })
        .catch(e => {
          this.errors.push(e);
        });
    },

Leave a comment