From 415a44db30a62f6c282bcb3fb30a6d571def8419 Mon Sep 17 00:00:00 2001 From: QMZ <1164250597@qq.com> Date: Tue, 17 Dec 2024 20:49:06 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=AE=8C=E5=96=84=E5=B8=96?= =?UTF-8?q?=E5=AD=90=E4=BB=A5=E5=8F=8A=E8=AF=84=E8=AE=BA=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/css/community/community.css | 26 +--- src/utils/axiosConfig.js | 1 + src/views/community/PostCard.vue | 192 ++++++++++++++++++++++--- src/views/community/Postform.vue | 6 +- src/views/community/trends.vue | 79 +++++----- 5 files changed, 223 insertions(+), 81 deletions(-) diff --git a/src/assets/css/community/community.css b/src/assets/css/community/community.css index 9cb0a82d..96cd3f10 100644 --- a/src/assets/css/community/community.css +++ b/src/assets/css/community/community.css @@ -1,35 +1,17 @@ -/* 设置进入和离开的过渡效果 */ +/* 离开动画 */ .post-list .fade-leave-active { transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out; } -.post-list .fade-enter-active { - transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out; -} - -/* 元素进入时,缩放并渐变 */ -.post-list .fade-leave-to /* .fade-leave-active in Vue 2.x */ { - opacity: 0; - transform: scale(0.5); /* 初始状态为缩小 */ -} -.post-list .fade-enter{ +.post-list .fade-leave-to /* 离开完成后状态 */ +{ opacity: 0; - transform: scale(0.5); /* 初始状态为缩小 */ + transform: translateX(100%) scale(0.5); /* 离开时从右边滑出并缩小 */ } -/* 元素进入时恢复到原尺寸 */ -.post-list .fade-enter-to { - opacity: 1; - transform: scale(1); /* 变大恢复正常尺寸 */ -} -/* 元素离开时,继续保持缩小状态 */ -.post-list .fade-leave-to { - opacity: 0; - transform: scale(0.5); /* 离开时缩小 */ -} diff --git a/src/utils/axiosConfig.js b/src/utils/axiosConfig.js index c0dfc6da..ed4c0d2b 100644 --- a/src/utils/axiosConfig.js +++ b/src/utils/axiosConfig.js @@ -6,6 +6,7 @@ import {getToken} from '@/token/auth' // 注意这里使用了解构赋值来导 const service = axios.create({ // baseURL: 'http://47.122.59.26:8080/api', // 配置基础URL 如果服务器域名发生变化统一可以去.env文件修改 // baseURL: 'http://10.205.10.22:8081/loveforest/api/', + // baseURL: 'http://10.133.13.52:8082/loveforest', timeout: 5000, // 请求超时时间 }); diff --git a/src/views/community/PostCard.vue b/src/views/community/PostCard.vue index f9fecb2d..28fd35b1 100644 --- a/src/views/community/PostCard.vue +++ b/src/views/community/PostCard.vue @@ -1,4 +1,5 @@