1.2.1 • Published 4 years ago
nuxt-ioc v1.2.1
nuxt-ioc - IOC containers for Vue/Nuxt frameworks
IoC/DI for Nuxt.js framework powered by Inversify.js and inspired by great Java Spring and Nest.js frameworks.
Requirements
Quick start
Please refer to our documentation for complete guide.
Example code
<template>
<div>My component content</div>
</template>
<script lang="ts">
import { Injectable, BaseComponent, Inject, factory } from 'nuxt';
import MyService from '~/Application/MyService';
@Injectable()
export class MyComponent extends BaseComponent {
@Inject(MyService)
private gMyService: MyService;
public async $fetch(): Promise<void> {
await this.gMyService.getMyData();
}
public $mounted(): void {
console.log('this is Vue mounted life hook');
}
}
export default factory(MyComponent);
</script>
Local Test
If you want test our example locally, you need change coreModule ind the index.ts
const options = {
// @ts-ignore
containerPath: '~/Application/container',
coreModule: '../../',
// coreModule: 'nuxt-ioc',
...moduleOptions,
};
1.2.1
4 years ago
1.2.0
4 years ago
1.1.0
4 years ago
1.0.18
4 years ago
1.0.17
4 years ago
1.0.16
4 years ago
1.0.15
4 years ago
1.0.14
4 years ago
1.0.13
5 years ago
1.0.12
5 years ago
1.0.9
5 years ago
1.0.11
5 years ago
1.0.10
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago