parsley/app/javascript/components/App.vue
2018-03-30 14:31:09 -05:00

34 lines
606 B
Vue

<template>
<div>
<app-navbar></app-navbar>
<section id="app" class="section">
<div class="container">
<router-view v-if="!hasError"></router-view>
<div v-else>
<h1>Error!</h1>
<p>{{error}}</p>
</div>
</div>
</section>
</div>
</template>
<script>
import { mapState } from "vuex";
import AppNavbar from "./AppNavbar";
export default {
computed: {
...mapState({
hasError: state => state.error !== null,
error: state => state.error
})
},
components: {
AppNavbar
}
}
</script>