Skip to content

Commit

Permalink
feat(page-header): add slots type (tusen-ai#6599)
Browse files Browse the repository at this point in the history
  • Loading branch information
nailiable committed Dec 7, 2024
1 parent 3304fee commit c4bf7d1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/page-header/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as NPageHeader, pageHeaderProps } from './src/PageHeader'
export type { PageHeaderProps } from './src/PageHeader'
export type { PageHeaderProps, PageHeaderSlots } from './src/PageHeader'
20 changes: 19 additions & 1 deletion src/page-header/src/PageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import type { ThemeProps } from '../../_mixins'
import type { ExtractPublicPropTypes } from '../../_utils'
import type { PageHeaderTheme } from '../styles/light'
import { computed, defineComponent, h, type PropType } from 'vue'
import {
computed,
defineComponent,
h,
type PropType,
type SlotsType
} from 'vue'
import { NBaseIcon } from '../../_internal'
import { ArrowBackIcon } from '../../_internal/icons'
import { useConfig, useTheme, useThemeClass } from '../../_mixins'
Expand All @@ -19,9 +25,21 @@ export const pageHeaderProps = {

export type PageHeaderProps = ExtractPublicPropTypes<typeof pageHeaderProps>

export interface PageHeaderSlots {
avatar?: any
header?: any
default?: any
extra?: any
footer?: any
subtitle?: any
title?: any
back?: any
}

export default defineComponent({
name: 'PageHeader',
props: pageHeaderProps,
slots: Object as SlotsType<PageHeaderSlots>,
setup(props) {
const { mergedClsPrefixRef, mergedRtlRef, inlineThemeDisabled }
= useConfig(props)
Expand Down

0 comments on commit c4bf7d1

Please sign in to comment.