Skip to content

Commit fa3d481

Browse files
committed
fix($core): vuejs#2627 Dup ID violates HTML5-2
1 parent 34935ca commit fa3d481

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/@vuepress/core/lib/client/components/OutboundLink.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<svg
33
class="icon outbound"
44
xmlns="http://www.w3.org/2000/svg"
5+
:aria-labelledby="rIdx"
56
role="img"
67
focusable="false"
78
x="0px"
@@ -10,7 +11,7 @@
1011
width="15"
1112
height="15"
1213
>
13-
<title>{{ openInNewWindowTitle }}</title>
14+
<title :id="rIdx">{{ openInNewWindowTitle }}</title>
1415
<path
1516
fill="currentColor"
1617
d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"
@@ -24,6 +25,11 @@
2425

2526
<script>
2627
export default {
28+
data: function () {
29+
return {
30+
rIdx: 'outbound-link-title-' + Math.floor(Math.random() * 1000000)
31+
}
32+
},
2733
computed: {
2834
openInNewWindowTitle () {
2935
return this.$themeLocaleConfig.openNewWindowText || '(opens new window)'

0 commit comments

Comments
 (0)