feat(theme): add target/rel props support for LinkCard (#556)

This commit is contained in:
pengzhanbo 2025-04-15 21:26:50 +08:00 committed by GitHub
parent 97f046015c
commit a0de3c660a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,7 @@ permalink: /guide/components/link-card/
| icon | `string \| { svg: string }` | `''` | 显示在标题左侧的图标,支持 iconify 所有图标,也可以使用 图片链接 |
| href | `string` | `''` | 链接 |
| description | `string` | `''` | 详情 |
| target | `string` | `''` | 链接打开方式 |
## 插槽

View File

@ -7,13 +7,15 @@ defineProps<{
title?: string
icon?: string | { svg: string }
description?: string
target?: string
rel?: string
}>()
</script>
<template>
<div class="vp-link-card">
<span class="body">
<VPLink :href="href" no-icon class="link no-icon">
<VPLink :href="href" no-icon class="link no-icon" v-bind="{ target, rel }">
<slot name="title">
<VPIcon v-if="icon" :name="icon" />
<span v-if="title" v-html="title" />