feat: 推荐帖子 调整

This commit is contained in:
2025-08-04 21:41:58 +08:00
parent c40c64c92f
commit 800052a900
5 changed files with 25 additions and 71 deletions

View File

@@ -2,9 +2,9 @@
<view class="container">
<ModuleTitle :title="recommendTheme.themeName" />
<view class="container-scroll">
<view class="mk-card-item" v-for="(item, index) in recommendTheme.recommendPostsList" :key="index">
<view class="mk-card-item" v-for="(item, index) in recommendTheme.recommendPostsList" :key="index" @click="sendReply(item)">
<image :src="item.coverPhoto" mode="widthFix"></image>
<text>{{ item.topic }}</text>
<text>{{ item.topic }} dd</text>
</view>
</view>
</view>
@@ -12,6 +12,8 @@
<script setup>
import ModuleTitle from '@/components/ModuleTitle/index.vue'
import { RECOMMEND_POSTS_TITLE } from '@/constant/constant.js'
import { defineProps } from 'vue'
const props = defineProps({
recommendTheme: {
@@ -19,6 +21,13 @@
default: {}
}
})
const sendReply = (item) => {
// 向父组件传递数据
const topic = item.topic.replace(/^#/, '');
console.log("======>", topic)
uni.$emit(RECOMMEND_POSTS_TITLE, topic);
}
</script>