zova-module-a-router 5.0.38 → 5.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-router",
3
- "version": "5.0.38",
3
+ "version": "5.0.39",
4
4
  "title": "a-router",
5
5
  "zovaModule": {
6
6
  "capabilities": {
@@ -37,5 +37,5 @@
37
37
  "dependencies": {
38
38
  "vue-router": "^4.3.2"
39
39
  },
40
- "gitHead": "90bb78df182aa8db862d6b44e86d23aa33b195fa"
40
+ "gitHead": "7ed3f754f876b8469790f652698b6c116ab377e8"
41
41
  }
@@ -7,7 +7,7 @@ const SymbolRouter = Symbol('SymbolRouter');
7
7
 
8
8
  export type BeanRouterLike = BeanRouter & Router;
9
9
 
10
- @Bean({ scene: 'bean', name: 'router', containerScope: 'ctx' })
10
+ @Bean()
11
11
  export class BeanRouter extends BeanBase {
12
12
  [SymbolRouter]: Router;
13
13
  eventRouterGuards: TypeEventOff;
@@ -27,6 +27,7 @@ export class BeanRouter extends BeanBase {
27
27
  if (!router) {
28
28
  throw new Error('Should provide router');
29
29
  }
30
+ this.app.vue.provide('a-router:router', Cast<BeanRouterLike>(this));
30
31
  this.bean.provide('a-router:router', Cast<BeanRouterLike>(this));
31
32
  // event
32
33
  this.eventRouterGuards = this.app.meta.event.on('a-router:routerGuards', async (context, next) => {
package/src/monkey.ts CHANGED
@@ -32,9 +32,9 @@ export class Monkey extends BeanSimple implements IMonkeySystem, IMonkeyModule,
32
32
  }
33
33
 
34
34
  async appInitialize(_bean: BeanContainerLike) {}
35
- async appInitialized(_bean: BeanContainerLike) {
35
+ async appInitialized(bean: BeanContainerLike) {
36
36
  // emit event
37
- const router = this.bean.inject('a-router:router');
37
+ const router = bean.inject('a-router:router');
38
38
  await this.app.meta.event.emit('a-router:routerGuards', router);
39
39
  }
40
40
  async beanInit(bean: BeanContainerLike, beanInstance: BeanBase) {