<template> <view class="event-list"> <view class="title"> <text>{{title}}</text> <view class="icon-text" @click="handleClick"> <text class="text">更多</text> <u-icon name="arrow-right-double" color="#0043ac" size="18"></u-icon> </view> </view> <view class="list"> <view class="list-item" v-for="item in showList" :key="item.id"> <text>{{item.title}}</text> </view> </view> </view> </template> <script> export default { name:"eventList", props: { title: { type: String, default: '通知公告' }, list: { type: Array, default: () => [] } }, computed: { showList() { return this.list.filter((item, index) => index < 5) } }, data() { return { }; }, methods: { // 点击更多 handleClick() { this.$emit('checkMore') } } } </script> <style lang="scss" scoped> .event-list { padding: 0 40rpx; .title { width: 100%; display: flex; flex-direction: row; justify-content: space-between; align-items: center; font-size: 36rpx; font-weight: 600; // padding: 20rpx 20rpx 0 20rpx; box-sizing: border-box; margin: 32rpx 0; .icon-text { display: flex; flex-direction: row; align-items: center; font-size: 34rpx; font-weight: 400; color: #0043ac; .text { margin-right: 16rpx; } } } .list { .list-item { margin: 32rpx 0; } } } </style>