From 5957720bfcf90f2ab4704ef4610807ca9136968a Mon Sep 17 00:00:00 2001 From: Kisechan Date: Wed, 5 Mar 2025 19:42:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8F=8B=E9=93=BE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=93=BE=E6=8E=A5=E5=92=8C?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=EF=BC=8C=E4=BC=98=E5=8C=96=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/links.yml | 17 +++++++++++++---- src/views/LinksView.vue | 14 +++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/public/links.yml b/public/links.yml index b02c363..42266b1 100644 --- a/public/links.yml +++ b/public/links.yml @@ -3,9 +3,18 @@ - avatar: "https://images.kisechan.space/icon.jpg" title: "Kisechan's Blog" description: "Kisechan 的博客" + url: "https://blog.kisechan.space" - avatar: "https://example.com/avatar.png" - title: "技术博客" - description: "这是一个技术博客" + title: "个人博客" + description: "这是一个个人博客" + url: "https://example.com/personal-blog" +- category: "友情链接" + links: - avatar: "https://example.com/avatar.png" - title: "技术博客" - description: "这是一个技术博客" \ No newline at end of file + title: "友情链接1" + description: "这是一个友情链接" + url: "https://example.com/friend-link-1" + - avatar: "https://example.com/avatar.png" + title: "友情链接2" + description: "这是一个友情链接" + url: "https://example.com/friend-link-2" \ No newline at end of file diff --git a/src/views/LinksView.vue b/src/views/LinksView.vue index a0f338d..4ec572a 100644 --- a/src/views/LinksView.vue +++ b/src/views/LinksView.vue @@ -17,6 +17,7 @@ @mouseenter="hoverEffect(`${categoryIndex}-${linkIndex}`)" @mouseleave="resetEffect" :style="cardStyle(`${categoryIndex}-${linkIndex}`)" + @click="openLink(link.url)" > - + @@ -82,14 +84,20 @@ export default { }; }; + const openLink = (url) => { + window.open(url, "_blank"); + }; + return { friendLinks, hoverEffect, resetEffect, cardStyle, + openLink, }; }, }; +