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', () => {
139139
140140 const Consumer = {
141141 setup ( ) {
142- const count = inject ( 'count' ) as Ref < number >
142+ const count = inject < Ref < number > > ( 'count' ) !
143143 return ( ) => count . value
144144 }
145145 }
@@ -169,7 +169,7 @@ describe('api: provide/inject', () => {
169169
170170 const Consumer = {
171171 setup ( ) {
172- const count = inject ( 'count' ) as Ref < number >
172+ const count = inject < Ref < number > > ( 'count' ) !
173173 // should not work
174174 count . value ++
175175 return ( ) => count . value
@@ -206,7 +206,7 @@ describe('api: provide/inject', () => {
206206
207207 const Consumer = {
208208 setup ( ) {
209- const state = inject ( 'state' ) as typeof rootState
209+ const state = inject < typeof rootState > ( 'state' ) !
210210 return ( ) => state . count
211211 }
212212 }
@@ -236,7 +236,7 @@ describe('api: provide/inject', () => {
236236
237237 const Consumer = {
238238 setup ( ) {
239- const state = inject ( 'state' ) as typeof rootState
239+ const state = inject < typeof rootState > ( 'state' ) !
240240 // should not work
241241 state . count ++
242242 return ( ) => state . count
You can’t perform that action at this time.
0 commit comments