feat: 调整首页组件目录结构
This commit is contained in:
41
pages/index/components/module/RecommendPostsList/index.vue
Normal file
41
pages/index/components/module/RecommendPostsList/index.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<ModuleTitle :title="recommendTheme.themeName" />
|
||||
<view class="container-scroll">
|
||||
<view
|
||||
v-for="(item, index) in recommendTheme.recommendPostsList"
|
||||
:key="index"
|
||||
>
|
||||
<view class="mk-card-item" @click="sendReply(item)">
|
||||
<image class="card-img" :src="item.coverPhoto" mode="aspectFill" />
|
||||
|
||||
<view class="overlay-gradient">
|
||||
<text class="overlay-text">{{ item.topic }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineProps } from "vue";
|
||||
import { RECOMMEND_POSTS_TITLE } from "@/constant/constant";
|
||||
import ModuleTitle from "@/components/ModuleTitle/index.vue";
|
||||
|
||||
const props = defineProps({
|
||||
recommendTheme: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
});
|
||||
|
||||
const sendReply = (item) => {
|
||||
const topic = item.userInputContent || item.topic.replace(/^#/, "");
|
||||
uni.$emit(RECOMMEND_POSTS_TITLE, topic);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./styles/index.scss";
|
||||
</style>
|
||||
Reference in New Issue
Block a user