This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/layouts/default.vue

51 lines
1.5 KiB
Vue
Raw Normal View History

2020-07-22 13:19:23 -07:00
<template>
2021-01-22 14:54:24 -08:00
<div class="d-flex flex-column vh-100">
2020-07-22 13:19:23 -07:00
<div class="flex-grow-1">
2020-09-23 11:34:35 -07:00
<Header/>
2021-05-13 03:09:08 -07:00
<main class="container">
2021-05-03 07:15:48 -07:00
<Nuxt/>
<ScrollButton/>
</main>
2020-07-22 13:19:23 -07:00
</div>
2021-05-13 03:09:08 -07:00
<div class="container">
2020-07-22 13:19:23 -07:00
<Footer/>
</div>
<DialogueBox ref="dialogue"/>
2021-01-06 06:21:20 -08:00
<Lightbox/>
2020-07-22 13:19:23 -07:00
</div>
</template>
2020-10-24 13:32:12 -07:00
<script>
import Vue from 'vue';
export default {
mounted() {
Vue.prototype.$alert = (message, color='primary') => {
return new Promise((resolve, reject) => {
this.$refs.dialogue.show(false, message, color, resolve, reject);
});
};
2020-10-24 13:32:12 -07:00
Vue.prototype.$confirm = (message, color='primary') => {
return new Promise((resolve, reject) => {
this.$refs.dialogue.show(true, message, color, resolve, reject);
2020-10-24 13:32:12 -07:00
});
};
Vue.prototype.$post = (url, data, options = {}, timeout = 30000) => {
return new Promise((resolve, reject) => {
this.$axios.$post(url, data, {...options, timeout})
.then(data => resolve(data))
.catch(async e => {
console.error(e);
await this.$alert(this.$t('error.generic'), 'danger');
reject();
});
});
}
2020-10-24 13:32:12 -07:00
}
}
</script>
2020-07-22 13:19:23 -07:00
<style lang="scss">
@import "assets/style";
</style>