ViewTitle.vue 1.26 KB
<template>
  <div class="content flex">
    <div class="logo user-select">
      <img style="height:3.17vh" src="@/assets/images/logo.png" alt="logo" />
    </div>
    <div class="view-title user-select">嘀加智慧门店运营看板</div>
    <div class="time">
      <div class="top flex">
        <img src="@/assets/images/time.png" class="icon" />
        <div class="now">{{ now }}</div>
      </div>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
export default {
  name: 'ViewTitle',
  data() {
    return {
      now: new Date().format('yyyy-MM-dd hh:mm:ss')
    }
  },
  mounted() {
    this.timer()
  },
  methods: {
    timer() {
      setInterval(() => {
        this.now = new Date().format('yyyy-MM-dd hh:mm:ss')
      }, 1e3)
    }
  }
}
</script>

<style scoped lang="scss">
.content {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0 42px 0 76px;
  justify-content: space-between;
  .view-title {
    font-weight: 600;
    font-size: 24px;
    color: #ffffff;
    letter-spacing: 8px;
    text-align: center;
  }
  .time {
    text-align: right;
    font-size: 14px;
    color: #ffffff;
    .top {
      justify-content: flex-end;
    }
    .icon {
      width: 14px;
      height: 14px;
      margin-right: 8px;
    }
  }
}
</style>