| | |
| | | <template> |
| | | <view class="post-card"> |
| | | <view class="post-card" @click="handleClick"> |
| | | <!-- 用户信息 --> |
| | | <view class="user-info"> |
| | | <up-avatar :src="avatar" size="80rpx" shape="circle" /> |
| | |
| | | content?: string; |
| | | likeCount?: number | string; |
| | | commentCount?: number | string; |
| | | detailUrl?: string; // 新增跳转链接 |
| | | } |
| | | |
| | | const props = defineProps<Props>(); |
| | | const imageHeight = ref(0) |
| | | |
| | | const handleClick = () => { |
| | | if (props.detailUrl) { |
| | | uni.navigateTo({ |
| | | url: props.detailUrl |
| | | }); |
| | | } |
| | | }; // 注意这里需要分号 |
| | | |
| | | const computeImageHeight = (src?: string) => { |
| | | if (!src) return |
| | | uni.getImageInfo({ |