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

18 lines
387 B
JavaScript
Raw Normal View History

2017-01-16 18:57:03 +01:00
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 })
2017-01-16 18:57:03 +01:00
}
}
}