@@ -24,12 +24,11 @@ import {
24
24
ComponentObjectPropsOptions
25
25
} from './componentProps'
26
26
import { EmitsOptions , EmitsToProps } from './componentEmits'
27
- import { extend , isFunction } from '@vue/shared'
27
+ import { IsSameType , extend , isFunction } from '@vue/shared'
28
28
import { VNodeProps } from './vnode'
29
29
import {
30
30
CreateComponentPublicInstance ,
31
- ComponentPublicInstanceConstructor ,
32
- IsSameType
31
+ ComponentPublicInstanceConstructor
33
32
} from './componentPublicInstance'
34
33
import { SlotsType } from './componentSlots'
35
34
@@ -58,7 +57,7 @@ export type DefineComponent<
58
57
Props = ResolveProps < PropsOrPropOptions , E > ,
59
58
Defaults = ExtractDefaultPropTypes < PropsOrPropOptions > ,
60
59
S extends SlotsType = { } ,
61
- Attrs extends AttrsType | undefined = undefined
60
+ Attrs extends AttrsType = Record < string , unknown >
62
61
> = ComponentPublicInstanceConstructor <
63
62
CreateComponentPublicInstance <
64
63
Props ,
@@ -108,8 +107,8 @@ export function defineComponent<
108
107
E extends EmitsOptions = { } ,
109
108
EE extends string = string ,
110
109
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
113
112
? { }
114
113
: UnwrapAttrsType < NonNullable < Attrs > >
115
114
> (
@@ -155,7 +154,7 @@ export function defineComponent<
155
154
E extends EmitsOptions = { } ,
156
155
EE extends string = string ,
157
156
S extends SlotsType = { } ,
158
- Attrs extends AttrsType | undefined = undefined ,
157
+ Attrs extends AttrsType = Record < string , unknown > ,
159
158
I extends ComponentInjectOptions = { } ,
160
159
II extends string = string
161
160
> (
@@ -205,7 +204,7 @@ export function defineComponent<
205
204
E extends EmitsOptions = { } ,
206
205
EE extends string = string ,
207
206
S extends SlotsType = { } ,
208
- Attrs extends AttrsType | undefined = undefined ,
207
+ Attrs extends AttrsType = Record < string , unknown > ,
209
208
I extends ComponentInjectOptions = { } ,
210
209
II extends string = string ,
211
210
Props = Readonly < { [ key in PropNames ] ?: any } >
@@ -259,7 +258,7 @@ export function defineComponent<
259
258
S extends SlotsType = { } ,
260
259
I extends ComponentInjectOptions = { } ,
261
260
II extends string = string ,
262
- Attrs extends AttrsType | undefined = undefined
261
+ Attrs extends AttrsType = Record < string , unknown >
263
262
> (
264
263
options : ComponentOptionsWithObjectProps <
265
264
PropsOptions ,
0 commit comments