Hangar/frontend/layouts/default.vue

45 lines
1.3 KiB
Vue
Raw Normal View History

2021-01-21 11:36:18 +08:00
<template>
<v-app>
2021-01-22 03:47:58 +08:00
<Header />
2021-01-21 11:36:18 +08:00
<v-main>
<v-container>
<template v-if="announcements">
<Announcement v-for="(announcement, idx) in announcements" :key="idx" :announcement="announcement" />
</template>
2021-02-09 04:45:54 +08:00
<DonationResult />
2021-01-21 11:36:18 +08:00
<nuxt />
</v-container>
</v-main>
2021-02-06 03:50:18 +08:00
<HangarSnackbar />
2021-01-22 03:47:58 +08:00
<Footer />
2021-01-21 11:36:18 +08:00
</v-app>
</template>
2021-02-06 03:50:18 +08:00
<script lang="ts">
2021-01-21 11:36:18 +08:00
import { Component, Vue } from 'nuxt-property-decorator';
2021-02-06 15:45:13 +08:00
import Header from '~/components/layouts/Header.vue';
import Footer from '~/components/layouts/Footer.vue';
import Announcement from '~/components/layouts/Announcement.vue';
2021-02-06 03:50:18 +08:00
import HangarSnackbar from '~/components/layouts/HangarSnackbar.vue';
2021-02-09 04:45:54 +08:00
import DonationResult from '~/components/donation/DonationResult.vue';
2021-01-21 11:36:18 +08:00
@Component({
components: {
2021-02-09 04:45:54 +08:00
DonationResult,
Header,
Footer,
Announcement,
2021-02-06 03:50:18 +08:00
HangarSnackbar,
},
})
2021-01-21 11:36:18 +08:00
export default class DefaultLayout extends Vue {
title = 'Hangar';
announcements: Announcement[] = [];
async fetch() {
this.announcements = await this.$api.requestInternal<Announcement[]>('data/announcements', false).catch<any>(this.$util.handlePageRequestError);
}
2021-01-21 11:36:18 +08:00
}
</script>