Skip to content

Commit 76c3475

Browse files
committed
访问过的a标签颜色更深一些
1 parent df54535 commit 76c3475

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

apps/InfoFlow/components/ExecutionDetails.vue

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,8 @@
177177
// 处理所有a标签的href属性
178178
const links = tempDiv.querySelectorAll('a');
179179
links.forEach((link) => {
180-
// 添加蓝色链接样式
181-
link.style.color = '#3b82f6';
182-
link.style.textDecoration = 'underline';
183-
link.style.textDecorationColor = '#3b82f6';
184-
link.style.textDecorationThickness = '1px';
185-
link.style.textUnderlineOffset = '2px';
186-
187-
// 添加hover效果
188-
link.style.cursor = 'pointer';
180+
// 添加类名
181+
link.className = 'execution-detail-link';
189182
190183
const href = link.getAttribute('href');
191184
if (
@@ -232,3 +225,27 @@
232225
return convertRelativeUrls(item.value, baseUrl);
233226
};
234227
</script>
228+
229+
<style scoped>
230+
/* 链接基础样式 */
231+
:deep(.execution-detail-link) {
232+
color: #3b82f6 !important;
233+
text-decoration: underline !important;
234+
text-decoration-color: #3b82f6 !important;
235+
text-decoration-thickness: 1px !important;
236+
text-underline-offset: 2px !important;
237+
cursor: pointer !important;
238+
}
239+
240+
/* 已访问链接的样式 */
241+
:deep(.execution-detail-link:visited) {
242+
color: #8b5cf6 !important;
243+
text-decoration-color: #8b5cf6 !important;
244+
}
245+
246+
/* 链接hover效果 */
247+
:deep(.execution-detail-link:hover) {
248+
color: #2563eb !important;
249+
text-decoration-color: #2563eb !important;
250+
}
251+
</style>

0 commit comments

Comments
 (0)