@@ -66,7 +66,7 @@ const AppWithProps = {
66
66
props : {
67
67
a : {
68
68
type : String ,
69
- required : true
69
+ required : true as true
70
70
}
71
71
} ,
72
72
template : ''
@@ -91,7 +91,7 @@ expectError(
91
91
)
92
92
93
93
const AppWithArrayProps = {
94
- props : [ 'a' ] ,
94
+ props : [ 'a' ] as [ 'a' ] ,
95
95
template : ''
96
96
}
97
97
@@ -134,16 +134,16 @@ mount(AppWithoutProps, {
134
134
// Functional tests
135
135
136
136
expectError (
137
- mount ( ( props : { a : 1 } ) => { } , {
137
+ mount ( ( props : { a : 1 } ) => { } , {
138
138
props : {
139
139
// @ts -expect-error wrong props
140
- a : '222'
140
+ a : '222'
141
141
}
142
142
} )
143
143
)
144
144
145
145
expectType < number > (
146
- mount ( ( props : { a : number } , ctx : any ) => { } , {
146
+ mount ( ( props : { a : number } , ctx : any ) => { } , {
147
147
props : {
148
148
a : 22
149
149
}
@@ -247,7 +247,7 @@ class CustomClassComponent<Props extends {} = {}> {
247
247
return this . props
248
248
}
249
249
context : SetupContext
250
- render ( ) : VNodeChild { }
250
+ render ( ) : VNodeChild { }
251
251
}
252
252
class NoPropCustomClassComponent extends CustomClassComponent {
253
253
count = ref ( 0 )
@@ -281,15 +281,17 @@ class WithPropCustomClassComponent extends CustomClassComponent<CustomClassCompo
281
281
282
282
expectError (
283
283
mount (
284
- WithPropCustomClassComponent as typeof WithPropCustomClassComponent & ( new ( ) => { $props : CustomClassComponentProps } ) ,
284
+ WithPropCustomClassComponent as typeof WithPropCustomClassComponent &
285
+ ( new ( ) => { $props : CustomClassComponentProps } ) ,
285
286
{
286
287
// @ts -expect-error should has props error
287
288
props : { }
288
289
}
289
290
)
290
291
)
291
292
mount (
292
- WithPropCustomClassComponent as typeof WithPropCustomClassComponent & ( new ( ) => { $props : CustomClassComponentProps } ) ,
293
+ WithPropCustomClassComponent as typeof WithPropCustomClassComponent &
294
+ ( new ( ) => { $props : CustomClassComponentProps } ) ,
293
295
{
294
296
props : { size : 'small' }
295
297
}
0 commit comments