File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed
test-workspace/tsc/passedFixtures/vue3.5 Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ import { exactType } from ' ../../shared' ;
3
+ defineProps <{
4
+ optionalBoolean? : boolean ;
5
+ }>();
6
+ </script >
7
+
8
+ <template >
9
+ <h1 >{{ exactType(optionalBoolean, {} as boolean | undefined) }}</h1 >
10
+ </template >
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ import { exactType } from ' ../../shared' ;
3
+ const props = defineProps <{
4
+ optionalBoolean? : boolean ;
5
+ }>();
6
+ </script >
7
+
8
+ <template >
9
+ <h1 >{{ exactType(optionalBoolean, true as boolean) }}</h1 >
10
+ </template >
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts" generic =" T extends { name: string }" >
2
+ const props = defineProps <{
3
+ one: T ;
4
+ all: Array <T >;
5
+ }>();
6
+ </script >
7
+
8
+ <template >
9
+ <div >
10
+ <!-- incorrect inference -->
11
+ <div >{{ one.name }}</div >
12
+ <!-- correct inference -->
13
+ <div >{{ props.one.name }}</div >
14
+ <ul >
15
+ <!-- correct inference -->
16
+ <li v-for =" el in all" >{{ el.name }}</li >
17
+ </ul >
18
+ </div >
19
+ </template >
You can’t perform that action at this time.
0 commit comments