pleroma-fe/src/components/style_switcher/style_switcher.js

20 lines
429 B
JavaScript
Raw Normal View History

2017-01-17 04:57:03 +11:00
export default {
2017-02-18 04:21:02 +11:00
data () {
return {
availableStyles: [],
selected: this.$store.state.config.theme
}
},
2017-01-17 04:57:03 +11:00
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 })
2017-01-17 04:57:03 +11:00
}
}
}