Add styleSwitcher.
This commit is contained in:
parent
afd90b84d0
commit
d644887d4c
69 changed files with 2086 additions and 9 deletions
20
src/components/style_switcher/style_switcher.js
Normal file
20
src/components/style_switcher/style_switcher.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
import StyleSetter from '../../services/style_setter/style_setter.js'
|
||||
|
||||
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 () {
|
||||
const fullPath = `/static/css/${this.selected}`
|
||||
StyleSetter.setStyle(fullPath)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue