-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Tabs): implemented click event and icon slot on
pf-tab
and all…
…owed to set href and target on the tab link
- Loading branch information
Showing
4 changed files
with
56 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template> | ||
<component :is="href ? 'a' : 'button'" :type="href ? undefined : 'button'" :href="href"> | ||
<slot /> | ||
</component> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'vue'; | ||
defineOptions({ | ||
name: 'PfTabButton', | ||
}); | ||
export interface Props extends /* @vue-ignore */ Omit<ButtonHTMLAttributes, 'type'>, /* @vue-ignore */ Omit<AnchorHTMLAttributes, 'type'> { | ||
/** URL associated with the Tab. A Tab with an href will render as an <a> instead of a <button>. A Tab inside a <Tabs component="nav"> should have an href. */ | ||
href?: string; | ||
} | ||
defineProps<Props>(); | ||
defineSlots<{ | ||
default?: (props?: Record<never, never>) => any; | ||
}>(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export { default as PfTabs } from './Tabs.vue'; | ||
export { default as PfTab } from './Tab.vue'; | ||
export { default as PfTabButton } from './TabButton.vue'; | ||
export { default as PfTabContent } from './TabContent.vue'; | ||
export { default as PfTabTitleText } from './TabTitleText.vue'; | ||
export { default as PfTabTitleIcon } from './TabTitleIcon.vue'; |