1
+ import { VNode , ComponentOptions as Vue2ComponentOptions } from 'vue'
1
2
import { Data } from './common'
2
3
import { ComponentPropsOptions , ExtractPropTypes } from './componentProps'
3
- import { VNode } from 'vue'
4
4
import { ComponentInstance , ComponentRenderProxy } from './componentProxy'
5
5
6
- import { ComponentOptions as Vue2ComponentOptions } from 'vue'
7
-
8
6
export interface SetupContext {
9
7
readonly attrs : Record < string , string >
10
8
readonly slots : { [ key : string ] : ( ...args : any [ ] ) => VNode [ ] }
@@ -43,12 +41,11 @@ interface ComponentOptionsBase<
43
41
D = Data ,
44
42
C extends ComputedOptions = { } ,
45
43
M extends MethodOptions = { }
46
- >
47
- extends Omit <
44
+ > extends Omit <
48
45
Vue2ComponentOptions < Vue , D , M , C , Props > ,
49
46
'data' | 'computed' | 'method' | 'setup' | 'props'
50
47
> {
51
- data ?: ( this : Props , vm : Props ) => D
48
+ data ?: ( this : Props & Vue , vm : Props ) => D
52
49
computed ?: C
53
50
methods ?: M
54
51
}
@@ -70,7 +67,7 @@ export type ComponentOptionsWithProps<
70
67
Props = ExtractPropTypes < PropsOptions >
71
68
> = ComponentOptionsBase < Props , D , C , M > & {
72
69
props ?: PropsOptions
73
- emits ?: string [ ] | Record < string , null | ( ( emitData : any ) => boolean ) >
70
+ emits ?: string [ ] | Record < string , null | ( ( emitData : any ) => boolean ) >
74
71
setup ?: SetupFunction < Props , RawBindings >
75
72
} & ThisType < ComponentRenderProxy < Props , RawBindings , D , C , M > >
76
73
0 commit comments