<script setup lang="ts">
import {detail} from "~/utils/common";
import dayjs from "dayjs";

const props = withDefaults(
    defineProps<{
      data?: any;
    }>(),
    {}
);
</script>

<template>
  <template v-if="data" v-for="(item,index) in data" key="index">
    <li class="clearfix">
      <a :href="detail(item)" class="n-left fl">
        <el-image :src="item.image" :fit="`scale-down`" class="w-[240px] h-[158px]" :alt="item.title" />
      </a>
      <div class="n-right fr">
        <h3><a :href="detail(item)" :title="item.title">{{ item.title }}</a></h3>
        <div v-html="item.comments" class="line-clamp-2"></div>
        <div class="date">{{ $t('createTime') }}：{{ dayjs(item.createTime).format('YYYY.MM.DD') }}</div>
        <div class="n-more" ><a :href="detail(item)"  >{{ $t('seeMore') }}>></a></div>
      </div>
    </li>
  </template>
  <div class="clearboth"></div>
</template>

<style scoped lang="scss">

</style>
