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';
|
2016-11-28 08:50:09 +01:00
|
|
|
import Modal from './components/Modal/Index.vue';
|
2016-10-10 10:57:39 +02:00
|
|
|
|
|
|
|
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: {
|
2016-11-28 08:50:09 +01:00
|
|
|
SiteHeader, Search, SiteFooter, Login, Modal
|
2016-10-10 10:57:39 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
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');
|