refactor(组件): 移除未使用的vue导入以优化代码
移除多个组件中未使用的`defineProps`和`defineEmits`导入,减少冗余代码并提高代码简洁性。同时更新部分文件的注释信息以保持一致性。
Showing
10 changed files
with
18 additions
and
15 deletions
| ... | @@ -14,7 +14,6 @@ | ... | @@ -14,7 +14,6 @@ |
| 14 | </template> | 14 | </template> |
| 15 | 15 | ||
| 16 | <script setup> | 16 | <script setup> |
| 17 | -import { defineProps } from 'vue' | ||
| 18 | import BottomNav from './BottomNav.vue' | 17 | import BottomNav from './BottomNav.vue' |
| 19 | import GradientHeader from '../ui/GradientHeader.vue' | 18 | import GradientHeader from '../ui/GradientHeader.vue' |
| 20 | 19 | ... | ... |
| 1 | +<!-- | ||
| 2 | + * @Date: 2025-03-20 20:36:36 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2025-03-21 15:37:21 | ||
| 5 | + * @FilePath: /mlaj/src/components/ui/ActivityCard.vue | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | +--> | ||
| 1 | <template> | 8 | <template> |
| 2 | <router-link :to="`/activities/${activity.id}`"> | 9 | <router-link :to="`/activities/${activity.id}`"> |
| 3 | <FrostedGlass class="flex overflow-hidden rounded-xl shadow-sm"> | 10 | <FrostedGlass class="flex overflow-hidden rounded-xl shadow-sm"> |
| ... | @@ -68,7 +75,6 @@ | ... | @@ -68,7 +75,6 @@ |
| 68 | </template> | 75 | </template> |
| 69 | 76 | ||
| 70 | <script setup> | 77 | <script setup> |
| 71 | -import { defineProps } from 'vue' | ||
| 72 | import FrostedGlass from './FrostedGlass.vue' | 78 | import FrostedGlass from './FrostedGlass.vue' |
| 73 | 79 | ||
| 74 | defineProps({ | 80 | defineProps({ | ... | ... |
| ... | @@ -31,7 +31,6 @@ | ... | @@ -31,7 +31,6 @@ |
| 31 | </template> | 31 | </template> |
| 32 | 32 | ||
| 33 | <script setup> | 33 | <script setup> |
| 34 | -import { defineProps, defineEmits } from 'vue' | ||
| 35 | import FrostedGlass from './FrostedGlass.vue' | 34 | import FrostedGlass from './FrostedGlass.vue' |
| 36 | 35 | ||
| 37 | const props = defineProps({ | 36 | const props = defineProps({ | ... | ... |
| 1 | +<!-- | ||
| 2 | + * @Date: 2025-03-20 20:36:36 | ||
| 3 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 4 | + * @LastEditTime: 2025-03-21 15:37:45 | ||
| 5 | + * @FilePath: /mlaj/src/components/ui/FrostedGlass.vue | ||
| 6 | + * @Description: 文件描述 | ||
| 7 | +--> | ||
| 1 | <template> | 8 | <template> |
| 2 | <div | 9 | <div |
| 3 | :class="[ | 10 | :class="[ |
| ... | @@ -10,8 +17,6 @@ | ... | @@ -10,8 +17,6 @@ |
| 10 | </template> | 17 | </template> |
| 11 | 18 | ||
| 12 | <script setup> | 19 | <script setup> |
| 13 | -import { defineProps } from 'vue' | ||
| 14 | - | ||
| 15 | defineProps({ | 20 | defineProps({ |
| 16 | className: { | 21 | className: { |
| 17 | type: String, | 22 | type: String, | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-03-20 15:33:07 | 2 | * @Date: 2025-03-20 15:33:07 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-03-21 11:11:19 | 4 | + * @LastEditTime: 2025-03-21 15:38:03 |
| 5 | * @FilePath: /mlaj/src/components/ui/LiveStreamCard.vue | 5 | * @FilePath: /mlaj/src/components/ui/LiveStreamCard.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -43,8 +43,6 @@ | ... | @@ -43,8 +43,6 @@ |
| 43 | </template> | 43 | </template> |
| 44 | 44 | ||
| 45 | <script setup> | 45 | <script setup> |
| 46 | -import { defineProps } from 'vue' | ||
| 47 | - | ||
| 48 | defineProps({ | 46 | defineProps({ |
| 49 | stream: { | 47 | stream: { |
| 50 | type: Object, | 48 | type: Object, | ... | ... |
| ... | @@ -15,7 +15,7 @@ | ... | @@ -15,7 +15,7 @@ |
| 15 | </template> | 15 | </template> |
| 16 | 16 | ||
| 17 | <script setup> | 17 | <script setup> |
| 18 | -import { defineProps, defineEmits, watch, ref } from 'vue' | 18 | +import { watch, ref } from 'vue' |
| 19 | import { useRouter } from 'vue-router' | 19 | import { useRouter } from 'vue-router' |
| 20 | import FrostedGlass from './FrostedGlass.vue' | 20 | import FrostedGlass from './FrostedGlass.vue' |
| 21 | 21 | ... | ... |
| ... | @@ -51,7 +51,7 @@ | ... | @@ -51,7 +51,7 @@ |
| 51 | </template> | 51 | </template> |
| 52 | 52 | ||
| 53 | <script setup> | 53 | <script setup> |
| 54 | -import { defineProps, onMounted, ref } from "vue"; | 54 | +import { onMounted, ref } from "vue"; |
| 55 | import Swiper from "swiper"; | 55 | import Swiper from "swiper"; |
| 56 | import { Pagination, EffectCards } from "swiper/modules"; | 56 | import { Pagination, EffectCards } from "swiper/modules"; |
| 57 | import "swiper/css"; | 57 | import "swiper/css"; | ... | ... |
| ... | @@ -125,7 +125,7 @@ const routes = [ | ... | @@ -125,7 +125,7 @@ const routes = [ |
| 125 | ] | 125 | ] |
| 126 | 126 | ||
| 127 | const router = createRouter({ | 127 | const router = createRouter({ |
| 128 | - history: createWebHistory(import.meta.env.VITE_BASE), | 128 | + history: createWebHistory(import.meta.env.VITE_BASE || '/'), |
| 129 | routes, | 129 | routes, |
| 130 | scrollBehavior(to, from, savedPosition) { | 130 | scrollBehavior(to, from, savedPosition) { |
| 131 | // 每次路由切换后,页面滚动到顶部 | 131 | // 每次路由切换后,页面滚动到顶部 | ... | ... |
-
Please register or login to post a comment