Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 613aead

Browse files
committed
Add mini-Vue test
1 parent 9558c21 commit 613aead

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/cases/compiler/recursion.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,27 @@ let o = {
1313
let x = o.m() // x: number
1414
let y = o.m2() // y: any
1515
let p = o.p // p: number
16+
17+
type Propertise<T> = { [K in keyof T]: T[K] };
18+
type Vue<T extends { data, methods, properties }> = T['data'] & T['methods'] & Propertise<T['properties']>;
19+
20+
let options = {
21+
data: {
22+
a: 12,
23+
},
24+
methods: {
25+
m1(this: Vue<typeof options>) {
26+
this.a;
27+
this.m2();
28+
return this.a + this.p.length;
29+
},
30+
m2(this: Vue<typeof options>) {
31+
return this.m1();
32+
}
33+
},
34+
properties: {
35+
p() { return 'foo' }
36+
}
37+
}
38+
39+
let app: Vue<typeof options>;

0 commit comments

Comments
 (0)