File tree 3 files changed +17
-2
lines changed
src/client/theme-default/components
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,12 @@ interface HeroAction {
69
69
70
70
// Destination link of the button.
71
71
link: string
72
+
73
+ // Link target attribute.
74
+ target? : string
75
+
76
+ // Link rel attribute.
77
+ rel? : string
72
78
}
73
79
```
74
80
@@ -144,6 +150,9 @@ interface Feature {
144
150
//
145
151
// e.g. `external`
146
152
rel? : string
153
+
154
+ // Link target attribute for the `link` option.
155
+ target? : string
147
156
}
148
157
149
158
type FeatureIcon =
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ interface Props {
9
9
theme? : ' brand' | ' alt' | ' sponsor'
10
10
text: string
11
11
href? : string
12
+ target? : string ;
13
+ rel? : string ;
12
14
}
13
15
const props = withDefaults (defineProps <Props >(), {
14
16
size: ' medium' ,
@@ -30,8 +32,8 @@ const component = computed(() => {
30
32
class =" VPButton"
31
33
:class =" [size, theme]"
32
34
:href =" href ? normalizeLink(href) : undefined"
33
- :target =" isExternal ? '_blank' : undefined"
34
- :rel =" isExternal ? 'noreferrer' : undefined"
35
+ :target =" props.target ?? ( isExternal ? '_blank' : undefined) "
36
+ :rel =" props.rel ?? ( isExternal ? 'noreferrer' : undefined) "
35
37
>
36
38
{{ text }}
37
39
</component >
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ export interface HeroAction {
8
8
theme? : ' brand' | ' alt'
9
9
text: string
10
10
link: string
11
+ target? : string
12
+ rel? : string
11
13
}
12
14
13
15
defineProps <{
@@ -43,6 +45,8 @@ const heroImageSlotExists = inject('hero-image-slot-exists') as Ref<boolean>
43
45
:theme =" action.theme"
44
46
:text =" action.text"
45
47
:href =" action.link"
48
+ :target =" action.target"
49
+ :rel =" action.rel"
46
50
/>
47
51
</div >
48
52
</div >
You can’t perform that action at this time.
0 commit comments