fix typescript errors

This commit is contained in:
Jake Potrebic 2021-01-21 15:08:06 -08:00
parent 35c15dbbe9
commit dc7eb9879d
No known key found for this signature in database
GPG Key ID: 7C58557EC9C421F8
3 changed files with 16 additions and 5 deletions

View File

@ -13,7 +13,7 @@ import { PropType } from 'vue';
@Component
export default class Card extends Vue {
@Prop({ type: Object as PropType<Announcement>, required: true })
announcement: Announcement;
announcement!: Announcement;
}
</script>

View File

@ -31,7 +31,7 @@ export interface Control {
@Component
export default class Card extends Vue {
@Prop({ type: Array as PropType<Control[]>, required: true })
controls: Control[];
controls!: Control[];
isRouterLink(control: Control): Boolean {
return control.link.startsWith('/');

View File

@ -64,13 +64,24 @@ import { Component, Vue } from 'nuxt-property-decorator';
import { Context } from '@nuxt/types';
import { PaginatedProjectList } from 'hangar-api';
// TODO move somewhere else
interface Category {
icon: string;
text: string;
}
interface Platform {
icon: string;
text: string;
}
@Component
export default class Home extends Vue {
projects?: PaginatedProjectList;
totalProjects: Number = 1337;
projectFilter: String = null;
projectFilter: String | null = null;
// TODO get categories from server
categories: Array = [
categories: Category[] = [
{
icon: 'mdi-home',
text: 'Test',
@ -78,7 +89,7 @@ export default class Home extends Vue {
];
// TODO get platforms from server
platforms: Array = [
platforms: Platform[] = [
{
icon: 'mdi-home',
text: 'Test',