pleroma-fe/src/components/style_switcher/style_switcher.js
2017-02-17 18:21:02 +01:00

19 lines
429 B
JavaScript

export default {
data () {
return {
availableStyles: [],
selected: this.$store.state.config.theme
}
},
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 })
}
}
}