noticeItem.vue 1.56 KB
<template>
    <div class="notice-root">
        <a :href="data.url">
            <p class="notice-content">{{data.name}}</p>
            <div class="time">
                <time> {{data.createTime}}</time>
            </div>
            <div class="item-split-line"/>
        </a>
    </div>
</template>

<script>
import {
    Style,
    Scroll,
    RecycleList
} from 'cube-ui';

export default {
    data(){
        return {};
    },
    props:{
        data: {
            type: Object,
            default() {
                return {};
            }
        }
    },
    created() {
        console.log(this.data)
    },
    methods: {
        onFetch: Function,
        goDetail(){
            this.$router.push({
                name: 'notice',
                params: {
                url: this.data.url,
                }
            });
        }

    },
    components: {
    Scroll,
    RecycleList,
    Style
  },
};
</script>

<style>
    .notice-root{
        margin-left: 40px;
        margin-right: 40px;
        padding-top: 32px;
    }
    .notice-content{
        font-family: 'PingFang-SC-Regular';
        font-size: 28px;
        color: #000000;
        line-height: 1.5;
        text-overflow: ellipsis;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .time {
        font-size: 28px;
        color: #999999;
        margin-top: 12px;
    }
    .item-split-line {
        height: 1px;
        width: 100%;
        background-color: #EEEEEE;
        margin-top: 32px;
    }

</style>