Array syntax
This commit is contained in:
parent
2d8a75c1f6
commit
5a77231282
5 changed files with 7 additions and 7 deletions
|
@ -31,7 +31,7 @@ export default class ImageCarousel extends Vue {
|
|||
private readonly contain!: boolean;
|
||||
|
||||
@Prop({ required: true })
|
||||
private readonly urls!: Array<string>;
|
||||
private readonly urls!: string[];
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ export default class Calendar extends Vue {
|
|||
private readonly title!: string;
|
||||
|
||||
@Prop({ default: () => [] })
|
||||
private readonly events!: Array<EventData>;
|
||||
private readonly events!: EventData[];
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ export default class CalendarCarousel extends Vue {
|
|||
private readonly speed!: number;
|
||||
|
||||
@Prop({ required: true })
|
||||
private readonly data!: Array<CalendarData>;
|
||||
private readonly data!: CalendarData[];
|
||||
|
||||
@Ref("main")
|
||||
private readonly _main?: Vue;
|
||||
|
@ -64,7 +64,7 @@ export default class CalendarCarousel extends Vue {
|
|||
clearInterval(this.interval);
|
||||
}
|
||||
|
||||
private get calendars(): Array<CalendarModel> {
|
||||
private get calendars(): CalendarModel[] {
|
||||
let arr = [];
|
||||
|
||||
for (const json_data of this.data) {
|
||||
|
|
|
@ -3,12 +3,12 @@ import { EventData, EventModel } from "./EventModel";
|
|||
|
||||
export type CalendarData = {
|
||||
title: string;
|
||||
events: Array<EventData>;
|
||||
events: EventData[];
|
||||
};
|
||||
|
||||
export class CalendarModel extends Model {
|
||||
public title: string;
|
||||
public events: Array<EventModel>;
|
||||
public events: EventModel[];
|
||||
|
||||
public constructor(json_data: CalendarData) {
|
||||
super();
|
||||
|
|
|
@ -49,7 +49,7 @@ export default class EventItem extends Vue {
|
|||
);
|
||||
|
||||
// decide which duration units to include
|
||||
let units: Array<keyof DurationLikeObject> = ["hours"];
|
||||
let units: (keyof DurationLikeObject)[] = ["hours"];
|
||||
|
||||
if (this.event.duration.as("days") >= 1) {
|
||||
// include days if duration is at least one day
|
||||
|
|
Loading…
Reference in a new issue