Stackedit/src/components/App.vue

55 lines
1.0 KiB
Vue
Raw Normal View History

2017-07-23 18:42:08 +00:00
<template>
<div v-if="ready" class="app" :class="{'app--loading': loading}">
2017-07-23 18:42:08 +00:00
<layout></layout>
<modal v-if="showModal"></modal>
2017-09-23 19:01:50 +00:00
<notification></notification>
2017-07-23 18:42:08 +00:00
</div>
<div v-else class="app__spash-screen"></div>
2017-07-23 18:42:08 +00:00
</template>
<script>
import Vue from 'vue';
import { mapState } from 'vuex';
2017-07-23 18:42:08 +00:00
import Layout from './Layout';
import Modal from './Modal';
2017-09-23 19:01:50 +00:00
import Notification from './Notification';
2017-07-23 18:42:08 +00:00
// Global directives
Vue.directive('focus', {
inserted(el) {
el.focus();
},
});
2017-07-23 18:42:08 +00:00
export default {
components: {
Layout,
Modal,
2017-09-23 19:01:50 +00:00
Notification,
2017-07-23 18:42:08 +00:00
},
2017-07-28 07:40:24 +00:00
computed: {
...mapState([
'ready',
]),
2017-07-28 07:40:24 +00:00
loading() {
2017-08-17 23:10:35 +00:00
return !this.$store.getters['content/current'].id;
2017-07-28 07:40:24 +00:00
},
showModal() {
2017-09-23 19:01:50 +00:00
return !!this.$store.getters['modal/config'];
},
2017-07-28 07:40:24 +00:00
},
2017-07-23 18:42:08 +00:00
};
</script>
<style lang="scss">
2017-07-28 20:04:12 +00:00
@import 'common/app';
.app__spash-screen {
2017-08-06 00:58:39 +00:00
margin: 0 auto;
max-width: 600px;
height: 100%;
background: no-repeat center url('../assets/logo.svg');
2017-08-06 00:58:39 +00:00
background-size: contain;
}
2017-07-23 18:42:08 +00:00
</style>