diff --git a/docs/en-US/component/link.md b/docs/en-US/component/link.md index 43ff1d960c..1d824b253e 100644 --- a/docs/en-US/component/link.md +++ b/docs/en-US/component/link.md @@ -63,6 +63,7 @@ link/with-icon | underline | whether the component has underline | ^[boolean] | true | | disabled | whether the component is disabled | ^[boolean] | false | | href | same as native hyperlink's `href` | ^[string] | — | +| target | same as native hyperlink's `target` | ^[enum]`'_blank' \| '_parent' \| '_self' \| '_top'` | _self |[string] | — | | icon | icon component | ^[string] / ^[Component] | — | ### Slots diff --git a/packages/components/link/src/link.ts b/packages/components/link/src/link.ts index ac8e45e301..6d6f34610d 100644 --- a/packages/components/link/src/link.ts +++ b/packages/components/link/src/link.ts @@ -1,5 +1,5 @@ import { buildProps, iconPropType } from '@element-plus/utils' -import type { ExtractPropTypes } from 'vue' +import type { ExtractPropTypes, PropType } from 'vue' import type Link from './link.vue' export const linkProps = buildProps({ @@ -26,6 +26,13 @@ export const linkProps = buildProps({ * @description same as native hyperlink's `href` */ href: { type: String, default: '' }, + /** + * @description same as native hyperlink's `target` + */ + target: { + type: String as PropType<'_blank' | '_parent' | '_self' | '_top' | string>, + default: '_self', + }, /** * @description icon component */ diff --git a/packages/components/link/src/link.vue b/packages/components/link/src/link.vue index d6fcedc06c..04f524d42f 100644 --- a/packages/components/link/src/link.vue +++ b/packages/components/link/src/link.vue @@ -2,6 +2,7 @@