File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change 2
2
ComponentPublicInstance ,
3
3
DefineComponent ,
4
4
VNode ,
5
- ComponentProps ,
6
5
ComponentInstance
7
6
} from 'vue'
8
7
import type { ComponentSlots } from 'vue-component-type-helpers'
@@ -11,6 +10,7 @@ import { MountingOptions } from './types'
11
10
import { trackInstance } from './utils/autoUnmount'
12
11
import { VueWrapper } from './vueWrapper'
13
12
import { createVueWrapper } from './wrapperFactory'
13
+ import { ComponentPropsWithDefaultOptional } from 'vue'
14
14
15
15
type ShimSlotReturnType < T > = T extends ( ...args : infer P ) => any
16
16
? ( ...args : P ) => any
@@ -35,14 +35,6 @@ export type ComponentMountingOptions<T, P> = Omit<
35
35
}
36
36
} & Record < string , unknown >
37
37
38
- // export function mount<T extends { new (): { $props: any } }>(
39
- // originalComponent: T,
40
- // options?: ComponentMountingOptions<T, ComponentProps<T>>
41
- // ): //VueWrapper<ComponentInstance<T>>
42
- // {
43
- // props: ComponentProps<T>
44
- // }
45
-
46
38
// defineComponent
47
39
export function mount <
48
40
T extends DefineComponent <
@@ -60,7 +52,7 @@ export function mount<
60
52
PropsOrOptions
61
53
> (
62
54
originalComponent : T ,
63
- options ?: ComponentMountingOptions < T , ComponentProps < T > >
55
+ options ?: ComponentMountingOptions < T , ComponentPropsWithDefaultOptional < T > >
64
56
) : VueWrapper < ComponentInstance < T > >
65
57
// implementation
66
58
export function mount (
Original file line number Diff line number Diff line change @@ -168,7 +168,6 @@ mount(ShimComponent, {
168
168
}
169
169
} )
170
170
171
- // TODO it should work
172
171
mount ( ShimComponent , {
173
172
data ( ) {
174
173
return {
You can’t perform that action at this time.
0 commit comments