chore(docs): added comment for target field (#1465)

---------

Signed-off-by: 秋雨落 <i@rain.cx>
Co-authored-by-agent: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
雨落
2026-03-24 12:55:15 +08:00
committed by GitHub
parent 9538068d0b
commit 8baaff7778
+14 -2
View File
@@ -8,10 +8,22 @@ interface HomePageConfig {
buttons: ButtonItem[]
}
export interface ButtonItem {
export interface ButtonItem extends Link {
primary?: boolean
}
export interface Link {
text?: string
link?: string
primary?: boolean
/**
* VitePress intercepts `<a>` tag clicks for SPA navigation, which can cause routing errors for external links.<br/>
* Adding a `target` attribute allows the browser to handle the navigation natively, avoiding this problem.
*
* See:<br/>
* https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#target<br/>
* https://stackoverflow.com/questions/79348337/redirect-main-title-link-in-vitepress-to-my-personal-website/79386388#79386388
*/
target?: string
}