feat: 调整首页组件目录结构
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view v-for="item in themeDTOList" :key="item.title">
|
||||
<RecommendPostsList :recommendTheme="item" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, nextTick } from "vue";
|
||||
import { SCROLL_TO_BOTTOM } from "@/constant/constant";
|
||||
import { discoveryCradComponent } from "@/request/api/MainPageDataApi";
|
||||
import RecommendPostsList from "../RecommendPostsList/index.vue";
|
||||
|
||||
const themeDTOList = ref([]);
|
||||
|
||||
const loadDiscoveryCradComponent = async () => {
|
||||
const res = await discoveryCradComponent();
|
||||
if (res.code === 0 && res.data) {
|
||||
themeDTOList.value = res.data.themeDTOList;
|
||||
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
uni.$emit(SCROLL_TO_BOTTOM, true);
|
||||
}, 300);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
loadDiscoveryCradComponent();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "./styles/index.scss";
|
||||
</style>
|
||||
@@ -0,0 +1,5 @@
|
||||
.container {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
Reference in New Issue
Block a user