feat: 推荐帖子 调整
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user