Hangar/frontend/pages/index.vue

23 lines
683 B
Vue
Raw Normal View History

2021-01-21 11:36:18 +08:00
<template>
<v-row justify="center" align="center">
<v-col cols="12" sm="8" md="6">
<ProjectList :projects="projects.result"></ProjectList>
</v-col>
</v-row>
</template>
<script lang="ts">
import { Component, Vue } from 'nuxt-property-decorator';
import { Context } from '@nuxt/types';
import { PaginatedProjectList } from 'hangar-api';
@Component
export default class Home extends Vue {
projects?: PaginatedProjectList;
async asyncData({ $api }: Context): Promise<{ projects: PaginatedProjectList }> {
return { projects: await $api.request<PaginatedProjectList>('projects', 'get', { limit: 25, offset: 0 }) };
}
}
</script>