<template>
  <div>{{ clock }}</div>
</template>

<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
import moment from "moment";

@Component
export default class ClockDisplay extends Vue {
  private clock = "";

  @Prop()
  format!: string;

  private update(): void {
    this.clock = moment().format(this.format);
  }

  private created(): void {
    setInterval(this.update, 1000);
  }
}
</script>

<style>
</style>