parsley/app/javascript/components/App.vue
Dan Elbert 18603dc783
Some checks failed
parsley/pipeline/head There was a failure building this commit
tasks
2018-09-06 18:16:13 -05:00

57 lines
1.0 KiB
Vue

<template>
<div>
<vue-progress-bar></vue-progress-bar>
<app-navbar></app-navbar>
<section id="app" class="">
<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 { mapMutations, mapState } from "vuex";
import api from "../lib/Api";
export default {
data() {
return {
api: api
};
},
computed: {
...mapState({
hasError: state => state.error !== null,
error: state => state.error,
authChecked: state => state.authChecked
})
},
watch: {
isLoading(val) {
if (val) {
this.$Progress.start();
} else {
this.$Progress.finish();
}
}
},
created() {
if (this.user === null && this.authChecked === false) {
this.checkAuthentication();
}
},
components: {
}
}
</script>