Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 更新日志中的超链接跳转由新窗口打开 #333

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/components/List/CoverList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ const getListData = async (id: number): Promise<SongType[]> => {
&:hover {
background-color: rgba(var(--primary), 0.12);
.cover {
border-radius: 16px 16px 0 0;
.cover-img {
transform: scale(1.1);
filter: brightness(0.8);
Expand Down
14 changes: 12 additions & 2 deletions src/components/Setting/AboutSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</n-tag>
<n-text :depth="3" class="time">{{ newVersion?.time }}</n-text>
</n-flex>
<div class="markdown-body" v-html="newVersion?.changelog" />
<div class="markdown-body" v-html="newVersion?.changelog" @click="jumpLink" />
</n-card>
</n-collapse-transition>
</div>
Expand All @@ -53,7 +53,7 @@
</n-tag>
<n-text :depth="3" class="time">{{ item?.time }}</n-text>
</n-flex>
<div class="markdown-body" v-html="item?.changelog" />
<div class="markdown-body" v-html="item?.changelog" @click="jumpLink" />
</n-card>
</n-collapse-item>
</n-collapse>
Expand Down Expand Up @@ -126,6 +126,16 @@ const checkUpdate = debounce(
{ leading: true, trailing: false },
);

// 链接跳转
const jumpLink = (e: MouseEvent) => {
const target = e.target as HTMLElement;
if (target.tagName !== "A") {
return;
}
e.preventDefault();
openLink((target as HTMLAnchorElement).href);
};

// 获取更新日志
const getUpdateData = async () => (updateData.value = await getUpdateLog());

Expand Down