完成适配移动端
This commit is contained in:
@@ -7,21 +7,18 @@
|
||||
<span class="text-large font-600"> {{ page.title }} </span>
|
||||
</template>
|
||||
<el-row :gutter="24" id="container" class="clearfix">
|
||||
<el-col v-for="(item,index) in list" :key="index" :xs="24" :sm="8" class="left mb-6">
|
||||
<el-col v-for="(item,index) in list" :key="index" :sm="6" :xs="24" class="left mb-6">
|
||||
<el-card shadow="hover" :body-style="{ padding: '0px' }" class=" hover:bg-gray-50 cursor-pointer" @click="navigateTo(`/detail/${item.articleId}.html`)">
|
||||
<el-image
|
||||
:src="item.image"
|
||||
fit="cover"
|
||||
:lazy="true" class="w-full md:h-[166px] h-[199px] cursor-pointer bg-gray-50"/>
|
||||
:lazy="true" class="w-full md:h-[166px] h-[199px] cursor-pointer bg-gray-50 transition-transform duration-300 ease-in-out hover:scale-110"/>
|
||||
<div class="flex-1 px-4 py-5 sm:p-6 !p-4">
|
||||
<div class="text-gray-700 dark:text-white text-base font-semibold flex flex-col gap-1.5">
|
||||
<div class="flex-1 text-xl cursor-pointer flex min-h-[56px]">
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="flex items-center gap-1.5 py-2 text-gray-500 justify-between">-->
|
||||
<!-- <div class="text-gray-500 line-clamp-2">{{ item.comments }}</div>-->
|
||||
<!-- </div>-->
|
||||
<div class="button-group flex justify-between items-center mt-3 text-sm">
|
||||
<el-space class="flex items-end">
|
||||
<div class="text-gray-400 gap-1 flex items-center"><el-icon><View /></el-icon><span>{{ getViews(item) }}</span></div>
|
||||
@@ -36,7 +33,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-page-header>
|
||||
<Pagination :total="total" @done="search" />
|
||||
<Pagination :pageSize="where.limit" :total="total" @done="search" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -65,7 +62,7 @@ const layout = useLayout();
|
||||
const where = reactive<CmsArticleParam>({
|
||||
keywords: '',
|
||||
page: 1,
|
||||
limit: 20,
|
||||
limit: 12,
|
||||
status: 0,
|
||||
parentId: undefined,
|
||||
categoryId: undefined,
|
||||
@@ -91,7 +88,6 @@ const reload = async () => {
|
||||
parentId: data.parentId == 0 ? data.navigationId : data.parentId
|
||||
}).then(categoryData => {
|
||||
category.value = categoryData;
|
||||
console.log(categoryData)
|
||||
// 加载文章列表
|
||||
if(data.parentId == 0 && category.value.length > 0){
|
||||
where.parentId = data.navigationId;
|
||||
|
||||
Reference in New Issue
Block a user