File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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: [] }>();
3540const downloadStatus = ref <boolean >(false );
3641const 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// 开始更新
3955const startDownload = async () => {
4056 downloadStatus .value = true ;
You can’t perform that action at this time.
0 commit comments