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

45 lines
899 B
JavaScript
Raw Normal View History

2016-10-10 10:57:39 +02:00
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')) {
2016-10-13 15:01:33 +02:00
localStorage.setItem('color', 'dark');
2016-10-10 10:57:39 +02:00
}
this.setColorScheme(localStorage.getItem('color'));
}
}
});
App.$mount('#app');