1
0
mirror of https://github.com/devfake/flox.git synced 2024-11-14 22:22:39 +01:00
flox/client/app/app.js
2016-11-28 08:50:09 +01:00

46 lines
956 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 Modal from './components/Modal/Index.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, Modal
},
methods: {
...mapActions([ 'setColorScheme' ]),
checkForUserColorScheme() {
if( ! localStorage.getItem('color')) {
localStorage.setItem('color', 'dark');
}
this.setColorScheme(localStorage.getItem('color'));
}
}
});
App.$mount('#app');