hookehuyr

refactor(导航): 将内部路由链接替换为外部链接

将HomePage.vue和ActivityCard.vue中的`<router-link>`替换为`<a>`标签和`window.open`方法,以便点击后在新标签页打开外部链接
<!--
* @Date: 2025-03-20 20:36:36
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-03-21 17:21:45
* @LastEditTime: 2025-03-24 14:32:02
* @FilePath: /mlaj/src/components/ui/ActivityCard.vue
* @Description: 文件描述
-->
<template>
<router-link :to="`/activities/${activity.id}`" class="block mb-4">
<div @click="navigateToActivity" class="block mb-4">
<FrostedGlass class="flex overflow-hidden rounded-xl shadow-sm">
<!-- Activity Image -->
<div class="w-1/3 h-28 relative">
......@@ -71,19 +71,23 @@
</div>
</div>
</FrostedGlass>
</router-link>
</div>
</template>
<script setup>
import FrostedGlass from './FrostedGlass.vue'
defineProps({
const props = defineProps({
activity: {
type: Object,
required: true
}
})
const navigateToActivity = () => {
window.open(`https://example.com/activities/${props.activity.id}`, '_blank')
}
const getStatusClass = (status) => {
switch (status) {
case '活动中':
......
......@@ -303,12 +303,12 @@
<section class="mb-7">
<div class="flex justify-between items-center mb-3">
<h3 class="font-medium">最新活动</h3>
<router-link to="/activities" class="text-xs text-gray-500 flex items-center">
<a href="https://www.mlaj.com/activities" target="_blank" class="text-xs text-gray-500 flex items-center">
更多
<svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3 ml-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
</svg>
</router-link>
</a>
</div>
<div class="space-y-4">
<div v-for="activity in activities.slice(0, 3)" :key="activity.id">
......