1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-15 06:32:34 +01:00
flox/client/app/app.js
2016-10-13 15:01:33 +02:00

45 lines
899 B
JavaScript

require('../resources/sass/app.scss');
import Vue from 'vue';
import { mapActions, mapState } from 'vuex'
import SiteHeader from './components/Header.vue';
import Search from './components/Search.vue';
import SiteFooter from './components/Footer.vue';
import Login from './components/Login.vue';
import router from './routes';
import store from './store/index';
const App = new Vue({
store,
router,
created() {
this.checkForUserColorScheme();
},
computed: {
...mapState({
colorScheme: state => state.colorScheme
})
},
components: {
SiteHeader, Search, SiteFooter, Login
},
methods: {
...mapActions([ 'setColorScheme' ]),
checkForUserColorScheme() {
if( ! localStorage.getItem('color')) {
localStorage.setItem('color', 'dark');
}
this.setColorScheme(localStorage.getItem('color'));
}
}
});
App.$mount('#app');