Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

@alt-javascript/boot-vue

Language npm version License: MIT CI

Vue 3 integration for the @alt-javascript framework. Bridges CDI-managed services into Vue's reactive system via provide/inject.

Part of the @alt-javascript monorepo.

Install

npm install @alt-javascript/boot-vue

CDN Usage (no build step)

<script type="module">
  import { createCdiApp } from '@alt-javascript/boot-vue';

  const { vueApp } = await createCdiApp({
    contexts: [context],
    config,
    rootComponent: App,
    createApp: Vue.createApp,
  });

  vueApp.mount('#app');
</script>

Vite / CLI Usage

import { createApp } from 'vue';
import { cdiPlugin } from '@alt-javascript/boot-vue';
import App from './App.vue';

const app = createApp(App);
app.use(cdiPlugin, { contexts: [context], config });
app.mount('#app');

In Components

import { inject } from 'vue';

const todoService = inject('todoService');
const ctx = inject('applicationContext');

All CDI singletons are provided by name. The full ApplicationContext is available as 'applicationContext' or 'ctx'.

License

MIT