Skip to content

Commit cc1c943

Browse files
committed
fix data issue
1 parent aa9fbe8 commit cc1c943

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

src/mount.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ type SlotDictionary = {
4949
}
5050

5151
interface MountingOptions<Props, Data = {}> {
52-
data?: () => {} extends Data
53-
? never
54-
: Data extends object
55-
? Partial<Data>
56-
: never
52+
data?: () => {} extends Data ? any : Data extends object ? Partial<Data> : any
5753
props?: Props
5854
/** @deprecated */
5955
propsData?: Props

test-dts/mount.d-test.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expectError, expectType } from 'tsd'
2-
import { DefineComponent, defineComponent } from 'vue'
2+
import { DefineComponent, defineComponent, reactive } from 'vue'
33
import { mount } from '../src'
44

55
const AppWithDefine = defineComponent({
@@ -27,16 +27,16 @@ expectType<string>(
2727
}).vm.a
2828
)
2929

30-
// no data provided
31-
expectError(
32-
mount(AppWithDefine, {
33-
data() {
34-
return {
35-
myVal: 1
36-
}
37-
}
38-
})
39-
)
30+
// // no data provided
31+
// expectError(
32+
// mount(AppWithDefine, {
33+
// data() {
34+
// return {
35+
// myVal: 1
36+
// }
37+
// }
38+
// })
39+
// )
4040

4141
// can not receive extra props
4242
expectError(
@@ -170,10 +170,10 @@ mount(ShimComponent, {
170170
})
171171

172172
// TODO it should work
173-
// mount(ShimedComponent, {
174-
// data() {
175-
// return {
176-
// a: 1
177-
// }
178-
// }
179-
// })
173+
mount(ShimComponent, {
174+
data() {
175+
return {
176+
a: 1
177+
}
178+
}
179+
})

0 commit comments

Comments
 (0)