File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/runtime-core/__tests__ Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ describe('api: provide/inject', () => {
139
139
140
140
const Consumer = {
141
141
setup ( ) {
142
- const count = inject ( 'count' ) as Ref < number >
142
+ const count = inject < Ref < number > > ( 'count' ) !
143
143
return ( ) => count . value
144
144
}
145
145
}
@@ -169,7 +169,7 @@ describe('api: provide/inject', () => {
169
169
170
170
const Consumer = {
171
171
setup ( ) {
172
- const count = inject ( 'count' ) as Ref < number >
172
+ const count = inject < Ref < number > > ( 'count' ) !
173
173
// should not work
174
174
count . value ++
175
175
return ( ) => count . value
@@ -206,7 +206,7 @@ describe('api: provide/inject', () => {
206
206
207
207
const Consumer = {
208
208
setup ( ) {
209
- const state = inject ( 'state' ) as typeof rootState
209
+ const state = inject < typeof rootState > ( 'state' ) !
210
210
return ( ) => state . count
211
211
}
212
212
}
@@ -236,7 +236,7 @@ describe('api: provide/inject', () => {
236
236
237
237
const Consumer = {
238
238
setup ( ) {
239
- const state = inject ( 'state' ) as typeof rootState
239
+ const state = inject < typeof rootState > ( 'state' ) !
240
240
// should not work
241
241
state . count ++
242
242
return ( ) => state . count
You can’t perform that action at this time.
0 commit comments