<template>
  <span :title="dateTime.title" class="th-date-show">
    <slot></slot>
    {{dateTime.fromNow}}
  </span>
</template>

<script>
import moment from 'moment'
import 'moment/dist/locale/zh-cn'
export default {
  props: {
    date: String,
  },
  computed: {
    dateTime() {
      const date = moment('2022-11-09')
      return {
        fromNow: date.fromNow(),
        title: date.format('YYYY-MM-DD HH:mm')
      }
    }
  }
}
</script>
