Skip to content

Commit 47ec9c7

Browse files
authored
Merge pull request #616 from uarix/dev
🐛 fix: update dialog hyperlinks opening in Electron window
2 parents c17f158 + 6f154a5 commit 47ec9c7

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/components/Modal/UpdateApp.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
</n-tag>
1111
</n-flex>
1212
<n-scrollbar style="max-height: 500px">
13-
<div v-if="data?.releaseNotes" class="markdown-body" v-html="data.releaseNotes" />
13+
<div
14+
v-if="data?.releaseNotes"
15+
class="markdown-body"
16+
v-html="data.releaseNotes"
17+
@click="handleMarkdownClick"
18+
/>
1419
<div v-else class="markdown-body">暂无更新日志</div>
1520
</n-scrollbar>
1621
<n-flex class="menu" justify="end">
@@ -35,6 +40,17 @@ const emit = defineEmits<{ close: [] }>();
3540
const downloadStatus = ref<boolean>(false);
3641
const downloadProgress = ref<number>(0);
3742
43+
// 处理markdown中的链接点击
44+
const handleMarkdownClick = (event: MouseEvent) => {
45+
const target = event.target as HTMLElement;
46+
// 从事件目标向上遍历,查找最近的 <a> 标签
47+
const anchor = target.closest('a');
48+
if (anchor?.href) {
49+
event.preventDefault();
50+
window.open(anchor.href, '_blank');
51+
}
52+
};
53+
3854
// 开始更新
3955
const startDownload = async () => {
4056
downloadStatus.value = true;

0 commit comments

Comments
 (0)