@@ -24,12 +24,11 @@ import {
2424 ComponentObjectPropsOptions
2525} from './componentProps'
2626import { EmitsOptions , EmitsToProps } from './componentEmits'
27- import { extend , isFunction } from '@vue/shared'
27+ import { IsSameType , extend , isFunction } from '@vue/shared'
2828import { VNodeProps } from './vnode'
2929import {
3030 CreateComponentPublicInstance ,
31- ComponentPublicInstanceConstructor ,
32- IsSameType
31+ ComponentPublicInstanceConstructor
3332} from './componentPublicInstance'
3433import { SlotsType } from './componentSlots'
3534
@@ -58,7 +57,7 @@ export type DefineComponent<
5857 Props = ResolveProps < PropsOrPropOptions , E > ,
5958 Defaults = ExtractDefaultPropTypes < PropsOrPropOptions > ,
6059 S extends SlotsType = { } ,
61- Attrs extends AttrsType | undefined = undefined
60+ Attrs extends AttrsType = Record < string , unknown >
6261> = ComponentPublicInstanceConstructor <
6362 CreateComponentPublicInstance <
6463 Props ,
@@ -108,8 +107,8 @@ export function defineComponent<
108107 E extends EmitsOptions = { } ,
109108 EE extends string = string ,
110109 S extends SlotsType = { } ,
111- Attrs extends AttrsType | undefined = undefined ,
112- PropsAttrs = IsSameType < undefined , Attrs > extends true
110+ Attrs extends AttrsType = Record < string , unknown > ,
111+ PropsAttrs = IsSameType < string , keyof Attrs > extends true
113112 ? { }
114113 : UnwrapAttrsType < NonNullable < Attrs > >
115114> (
@@ -155,7 +154,7 @@ export function defineComponent<
155154 E extends EmitsOptions = { } ,
156155 EE extends string = string ,
157156 S extends SlotsType = { } ,
158- Attrs extends AttrsType | undefined = undefined ,
157+ Attrs extends AttrsType = Record < string , unknown > ,
159158 I extends ComponentInjectOptions = { } ,
160159 II extends string = string
161160> (
@@ -205,7 +204,7 @@ export function defineComponent<
205204 E extends EmitsOptions = { } ,
206205 EE extends string = string ,
207206 S extends SlotsType = { } ,
208- Attrs extends AttrsType | undefined = undefined ,
207+ Attrs extends AttrsType = Record < string , unknown > ,
209208 I extends ComponentInjectOptions = { } ,
210209 II extends string = string ,
211210 Props = Readonly < { [ key in PropNames ] ?: any } >
@@ -259,7 +258,7 @@ export function defineComponent<
259258 S extends SlotsType = { } ,
260259 I extends ComponentInjectOptions = { } ,
261260 II extends string = string ,
262- Attrs extends AttrsType | undefined = undefined
261+ Attrs extends AttrsType = Record < string , unknown >
263262> (
264263 options : ComponentOptionsWithObjectProps <
265264 PropsOptions ,
0 commit comments