aboutsummaryrefslogtreecommitdiff
path: root/src/components/style_switcher/style_switcher.js
blob: 954e2ff06317d42d768979e05eafe46805415027 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
export default {
  data: () => ({
    availableStyles: [],
    selected: false
  }),
  created () {
    const self = this
    window.fetch('/static/css/themes.json')
      .then((data) => data.json())
      .then((themes) => { self.availableStyles = themes })
  },
  watch: {
    selected () {
      this.$store.dispatch('setOption', { name: 'theme', value: this.selected })
    }
  }
}