A type extending AppDepsMap representing the container of registered services.
The Vue application instance.
The object containing all services or service factories to register.
Optionaloptions: RegisterDepsOptionsOptional configuration for global attachment.
import { createApp } from "vue"
import App from "./App.vue"
import { registerDeps } from "@your-scope/vue-deps"
import { UserService, AuthService } from "./services"
const app = createApp(App)
registerDeps(app, {
userService: () => new UserService(),
authService: () => new AuthService()
}, {
globalDeps: true,
globalDepsNameOverride: "myDeps" // optional custom global function name
})
app.mount("#app")
Registers an application's dependencies in Vue's DI system.
Provides the services/factories via Vue's
provide/injectsystem, and optionally attaches a global function toapp.config.globalProperties.