@kaokei/use-vue-service

Lightweight Vue 3 state management with dependency injection, inspired by Angular services.
2,096 5
Install
npm install @kaokei/use-vue-service
Latest Version:4.0.5
Vue:3
License:MIT
Last Updated:May 11, 2026
Links: GitHub  ·  npm
Maintainer: kaokei

npm install @kaokei/use-vue-service

Build Status Coverage Status Downloads Version License GitHub Created At

灵感来自 angular 中的服务的概念。在 angular 中不需要全局唯一的数据源 store。而是通过声明服务,以及向组件中注入服务来达到数据管理以及数据共享的。

本库也是实现了类似的效果,可以通过依赖注入实现面向服务编程、实现领域驱动开发。从而可以代替 vuex/pinia。

本库通过类来声明服务,对 typescript 支持非常棒。

Todo List

  1. 改成tsdown来打包代码

Related Packages

vue-di-container

Dependency injection container for Vue

1,460 1
@vue-ioc/core

IoC and DI for Vue powered by InversifyJS and inspired by Angular @Module syntac...

671 44
nuxt-ioc

Nuxt IOC implementation

5,235 7
vue3-oop

vue3-oop take class component and di into vue

4,719 167
@nonnajs/vue

Vue bindings for @nonnajs/di - a component plus useInjection()/useOptionalInject...

439 2

Version History

Version Released Vue License
4.0.5 ^3.5.13 MIT
4.0.4 ^3.5.13 MIT
4.0.3 ^3.5.13 MIT
4.0.2 ^3.5.13 MIT
4.0.1 ^3.5.13 MIT