zova-module-a-router 5.0.63 → 5.0.65

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.63",
3
+ "version": "5.0.65",
4
4
  "title": "a-router",
5
5
  "zovaModule": {
6
6
  "capabilities": {
@@ -40,5 +40,5 @@
40
40
  "dependencies": {
41
41
  "vue-router": "^4.4.5"
42
42
  },
43
- "gitHead": "200ff5791bd6362080428f5b6c6c8f2a82c7d9d0"
43
+ "gitHead": "1aade8046f4e35d238fe490542d128a64e969ea4"
44
44
  }
@@ -15,13 +15,16 @@ declare module 'zova' {
15
15
  export * from '../config/config.js';
16
16
  import { config } from '../config/config.js';
17
17
  /** config: end */
18
+ /** monkey: begin */
19
+ export * from '../monkey.js';
20
+ /** monkey: end */
18
21
  /** scope: begin */
19
22
  import { BeanScopeBase, Scope, TypeModuleResource } from 'zova';
20
23
 
21
24
  @Scope()
22
25
  export class ScopeModuleARouter extends BeanScopeBase {}
23
26
 
24
- export interface ScopeModuleARouter extends TypeModuleResource<any, typeof config, any, any, any, any> {}
27
+ export interface ScopeModuleARouter extends TypeModuleResource<typeof config, any, any, any, any> {}
25
28
 
26
29
  import 'zova';
27
30
  declare module 'zova' {
@@ -1,7 +1,5 @@
1
- import { IBeanScopeRecord, ZovaApplication } from 'zova';
1
+ import { ZovaApplication } from 'zova';
2
2
 
3
3
  export const config = (_app: ZovaApplication) => {
4
- return {
5
- defaultComponent: 'home-base' as keyof IBeanScopeRecord,
6
- };
4
+ return {};
7
5
  };
package/src/index.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from './.metadata/index.js';
2
2
  export * from './types.js';
3
- export * from './monkey.js';
package/src/monkey.ts CHANGED
@@ -6,23 +6,25 @@ import {
6
6
  IModule,
7
7
  IMonkeyModule,
8
8
  IMonkeyController,
9
- IMonkeySystem,
10
9
  IControllerData,
11
10
  TypePageSchema,
12
11
  useComputed,
12
+ IMonkeyAppInitialize,
13
+ IMonkeyAppInitialized,
14
+ IMonkeyAppReady,
13
15
  } from 'zova';
14
16
  import * as ModuleInfo from '@cabloy/module-info';
15
17
  import { useRoute } from 'vue-router';
16
18
  import { BeanRouter } from './bean/bean.router.js';
17
- import { ScopeModule, __ThisModule__ } from './.metadata/this.js';
18
- import { markRaw } from 'vue';
19
19
  import { getRealRouteName } from './utils.js';
20
20
  import { LocalRouter } from './bean/local.router.js';
21
21
 
22
- export class Monkey extends BeanSimple implements IMonkeySystem, IMonkeyModule, IMonkeyController {
22
+ export class Monkey
23
+ extends BeanSimple
24
+ implements IMonkeyAppInitialize, IMonkeyAppInitialized, IMonkeyAppReady, IMonkeyModule, IMonkeyController
25
+ {
23
26
  private _moduleSelf: IModule;
24
27
  private _beanRouter: BeanRouter;
25
- private _beanComponentDefault: any;
26
28
  localRouter: LocalRouter;
27
29
 
28
30
  constructor(moduleSelf: IModule) {
@@ -43,9 +45,6 @@ export class Monkey extends BeanSimple implements IMonkeySystem, IMonkeyModule,
43
45
  this.localRouter = await this.bean._newBean(LocalRouter, false);
44
46
  }
45
47
  async appInitialized() {
46
- // component default
47
- const scope: ScopeModule = await this.bean.getScope(__ThisModule__);
48
- this._beanComponentDefault = await this.bean.getScope(scope.config.defaultComponent);
49
48
  // emit event
50
49
  await this.app.meta.event.emit('a-router:routerGuards', this._beanRouter);
51
50
  }
@@ -63,7 +62,6 @@ export class Monkey extends BeanSimple implements IMonkeySystem, IMonkeyModule,
63
62
  }
64
63
  }
65
64
  async beanInit(bean: BeanContainer, beanInstance: BeanBase) {
66
- const self = this;
67
65
  bean.defineProperty(beanInstance, '$router', {
68
66
  enumerable: false,
69
67
  configurable: true,
@@ -71,17 +69,7 @@ export class Monkey extends BeanSimple implements IMonkeySystem, IMonkeyModule,
71
69
  return bean._getBeanFromHost('a-router.bean.router');
72
70
  },
73
71
  });
74
- bean.defineProperty(beanInstance, '$component', {
75
- enumerable: false,
76
- configurable: true,
77
- get() {
78
- return markRaw(self._beanComponentDefault.component);
79
- },
80
- });
81
72
  }
82
- async beanInited(_bean: BeanContainer, _beanInstance: BeanBase) {}
83
- beanDispose(_bean: BeanContainer, _beanInstance: BeanBase) {}
84
- beanDisposed(_bean: BeanContainer, _beanInstance: BeanBase) {}
85
73
  async moduleLoading(module: IModule) {
86
74
  if (this._moduleSelf === module) return;
87
75
  const beanRouter = await this.getBeanRouter();