| | |
| | | </view> |
| | | </view> |
| | | <view class="comment-opeartor"> |
| | | <up-icon name="heart" size="30rpx" /> |
| | | <up-icon |
| | | name="heart" |
| | | size="30rpx" |
| | | :color="isLiked ? '#FF0000' : '#B9B9B9'" |
| | | @click="() => handleLike(props.id)" |
| | | /> |
| | | <view class="comment-opeartor-heart-number">{{ likes }}</view> |
| | | </view> |
| | | </view> |
| | |
| | | address: string |
| | | likes: number |
| | | filmInfo: CommentDTO |
| | | isLiked: boolean |
| | | id: number |
| | | }>() |
| | | |
| | | const emit = defineEmits<{ |
| | | (e: 'reply'): void |
| | | (e: 'reply', id: number): void |
| | | (e: 'like', id: number): void |
| | | }>() |
| | | |
| | | const onReply = () => { |
| | | emit('reply') |
| | | console.log("onReply",props) |
| | | emit('reply', props.id) |
| | | } |
| | | |
| | | const handleLike = (id: number) => { // 添加参数 |
| | | console.log("handleLike", id) |
| | | emit('like', id) |
| | | } |
| | | </script> |
| | | |