Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a property "target" for setting the redirect action for featu… #2897

Merged
merged 3 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/client/theme-default/components/VPFeature.vue
Expand Up @@ -11,11 +11,17 @@ defineProps<{
link?: string
linkText?: string
rel?: string
target?: string
}>()
</script>

<template>
<VPLink class="VPFeature" :href="link" :rel="rel" :no-icon="true" :tag="link ? 'a' : 'div'">
<VPLink class="VPFeature" :href="link"
:rel="rel"
:target="target ? '_blank' : ''"
brc-dd marked this conversation as resolved.
Show resolved Hide resolved
:no-icon="true"
:tag="link ? 'a' : 'div'"
>
<article class="box">
<VPImage
v-if="typeof icon === 'object'"
Expand Down
2 changes: 2 additions & 0 deletions src/client/theme-default/components/VPFeatures.vue
Expand Up @@ -10,6 +10,7 @@ export interface Feature {
link?: string
linkText?: string
rel?: string
target?: string
}

const props = defineProps<{
Expand Down Expand Up @@ -50,6 +51,7 @@ const grid = computed(() => {
:link="feature.link"
:link-text="feature.linkText"
:rel="feature.rel"
:target="feature.target"
/>
</div>
</div>
Expand Down