Array syntax

This commit is contained in:
Jörn-Michael Miehe 2022-09-15 19:08:15 +00:00
parent 2d8a75c1f6
commit 5a77231282
5 changed files with 7 additions and 7 deletions

View file

@ -31,7 +31,7 @@ export default class ImageCarousel extends Vue {
private readonly contain!: boolean; private readonly contain!: boolean;
@Prop({ required: true }) @Prop({ required: true })
private readonly urls!: Array<string>; private readonly urls!: string[];
} }
</script> </script>

View file

@ -29,7 +29,7 @@ export default class Calendar extends Vue {
private readonly title!: string; private readonly title!: string;
@Prop({ default: () => [] }) @Prop({ default: () => [] })
private readonly events!: Array<EventData>; private readonly events!: EventData[];
} }
</script> </script>

View file

@ -31,7 +31,7 @@ export default class CalendarCarousel extends Vue {
private readonly speed!: number; private readonly speed!: number;
@Prop({ required: true }) @Prop({ required: true })
private readonly data!: Array<CalendarData>; private readonly data!: CalendarData[];
@Ref("main") @Ref("main")
private readonly _main?: Vue; private readonly _main?: Vue;
@ -64,7 +64,7 @@ export default class CalendarCarousel extends Vue {
clearInterval(this.interval); clearInterval(this.interval);
} }
private get calendars(): Array<CalendarModel> { private get calendars(): CalendarModel[] {
let arr = []; let arr = [];
for (const json_data of this.data) { for (const json_data of this.data) {

View file

@ -3,12 +3,12 @@ import { EventData, EventModel } from "./EventModel";
export type CalendarData = { export type CalendarData = {
title: string; title: string;
events: Array<EventData>; events: EventData[];
}; };
export class CalendarModel extends Model { export class CalendarModel extends Model {
public title: string; public title: string;
public events: Array<EventModel>; public events: EventModel[];
public constructor(json_data: CalendarData) { public constructor(json_data: CalendarData) {
super(); super();

View file

@ -49,7 +49,7 @@ export default class EventItem extends Vue {
); );
// decide which duration units to include // decide which duration units to include
let units: Array<keyof DurationLikeObject> = ["hours"]; let units: (keyof DurationLikeObject)[] = ["hours"];
if (this.event.duration.as("days") >= 1) { if (this.event.duration.as("days") >= 1) {
// include days if duration is at least one day // include days if duration is at least one day