Update theme.js (#4068)

More clear option
This commit is contained in:
Илья 2018-10-10 18:09:21 +03:00 committed by Clark Du
parent 9bb76bcf7d
commit 90db0aded8

View File

@ -1,5 +1,5 @@
export default ({ route, app }) => {
export default ({ route, store }) => {
// Take the last value (latest route child)
const theme = route.meta.reduce((theme, meta) => meta.theme || theme, 'light')
app.store.commit('SET_THEME', theme)
store.commit('SET_THEME', theme)
}