generated from kevisual/vite-react-template
feat: 在 RepoCard 组件中添加站点链接点击事件,防止事件冒泡
This commit is contained in:
@@ -307,8 +307,9 @@ export function RepoCard({ showReturn = false, repo }: RepoCardProps) {
|
|||||||
{repo.site && (
|
{repo.site && (
|
||||||
<div
|
<div
|
||||||
className="text-xs text-neutral-500 hover:text-neutral-900 hover:underline flex transition-colors"
|
className="text-xs text-neutral-500 hover:text-neutral-900 hover:underline flex transition-colors"
|
||||||
onClick={() => {
|
onClick={(e) => {
|
||||||
window.open(repo.site, '_blank')
|
window.open(repo.site, '_blank')
|
||||||
|
e.stopPropagation()
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LinkIcon className="w-4 h-4 shrink-0 mr-2" />
|
<LinkIcon className="w-4 h-4 shrink-0 mr-2" />
|
||||||
|
|||||||
Reference in New Issue
Block a user