0👍
inject
, etc. decorators cannot be used with component class. The use of decorators assumes that the class is instantiated by Inversify injector, while component class is instantiated by Vue framework, so a parameter that is provided to component constructor won’t be an instance of AuthService
. This is what type error warns about.
The same problem is applicable to React components or any other framework that doesn’t use Inversify internally.
Inversify container should be accessed manually:
authService: AuthService = container.get(AuthService)
Since Vue already provides DI, it may be more convenient to use its own DI instead of third-party library like Inversify.
0👍
You could try to use this one vue-injector
- [Vuejs]-Cannot run Grails 4 multi project build with Vue profile in parallel
- [Vuejs]-Strange behavior with JQuery and Vuejs
Source:stackexchange.com