@ctzy-web-client/web-base-client-vue 1.0.1

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.
Files changed (86) hide show
  1. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  2. package/es/_virtual/_rollupPluginBabelHelpers.mjs +2830 -0
  3. package/es/application/Application2.mjs +42 -0
  4. package/es/application/MicroApplication.mjs +49 -0
  5. package/es/application/app.mjs +34 -0
  6. package/es/application/application.mjs +312 -0
  7. package/es/application/index.mjs +11 -0
  8. package/es/application/micro-application.mjs +59 -0
  9. package/es/constants/index.mjs +1 -0
  10. package/es/hooks/index.mjs +11 -0
  11. package/es/hooks/use-data-form/index.mjs +18 -0
  12. package/es/hooks/use-data-table/index.mjs +18 -0
  13. package/es/hooks/use-data-table-page/index.mjs +47 -0
  14. package/es/hooks/use-event-dispatcher/index.mjs +14 -0
  15. package/es/hooks/use-global-config/index.mjs +47 -0
  16. package/es/hooks/use-keydown/index.mjs +2 -0
  17. package/es/hooks/use-keydown/use-keydown.mjs +24 -0
  18. package/es/hooks/use-keydown/use-save-keydown.mjs +12 -0
  19. package/es/hooks/use-namespace/index.mjs +68 -0
  20. package/es/hooks/use-service/index.mjs +9 -0
  21. package/es/hooks/use-value/index.mjs +9 -0
  22. package/es/index.mjs +20 -0
  23. package/es/interceptors/RequestInterceptors.mjs +25 -0
  24. package/es/interceptors/RouterInterceptors.mjs +36 -0
  25. package/es/interceptors/index.mjs +2 -0
  26. package/es/ioc/ReactiveInstantiationService.mjs +14 -0
  27. package/es/ioc/index.mjs +1 -0
  28. package/es/utils/index.mjs +1 -0
  29. package/es/utils/pageDataParser.mjs +21 -0
  30. package/lib/_virtual/_plugin-vue_export-helper.js +13 -0
  31. package/lib/_virtual/_rollupPluginBabelHelpers.js +2948 -0
  32. package/lib/application/Application2.js +46 -0
  33. package/lib/application/MicroApplication.js +53 -0
  34. package/lib/application/app.js +38 -0
  35. package/lib/application/application.js +316 -0
  36. package/lib/application/index.js +18 -0
  37. package/lib/application/micro-application.js +63 -0
  38. package/lib/constants/index.js +2 -0
  39. package/lib/hooks/index.js +30 -0
  40. package/lib/hooks/use-data-form/index.js +22 -0
  41. package/lib/hooks/use-data-table/index.js +22 -0
  42. package/lib/hooks/use-data-table-page/index.js +51 -0
  43. package/lib/hooks/use-event-dispatcher/index.js +18 -0
  44. package/lib/hooks/use-global-config/index.js +52 -0
  45. package/lib/hooks/use-keydown/index.js +11 -0
  46. package/lib/hooks/use-keydown/use-keydown.js +28 -0
  47. package/lib/hooks/use-keydown/use-save-keydown.js +16 -0
  48. package/lib/hooks/use-namespace/index.js +73 -0
  49. package/lib/hooks/use-service/index.js +13 -0
  50. package/lib/hooks/use-value/index.js +13 -0
  51. package/lib/index.js +68 -0
  52. package/lib/interceptors/RequestInterceptors.js +29 -0
  53. package/lib/interceptors/RouterInterceptors.js +40 -0
  54. package/lib/interceptors/index.js +11 -0
  55. package/lib/ioc/ReactiveInstantiationService.js +18 -0
  56. package/lib/ioc/index.js +9 -0
  57. package/lib/utils/index.js +9 -0
  58. package/lib/utils/pageDataParser.js +25 -0
  59. package/package.json +37 -0
  60. package/src/application/Application.js +538 -0
  61. package/src/application/MicroApplication.js +67 -0
  62. package/src/application/app.vue +22 -0
  63. package/src/application/application.vue +36 -0
  64. package/src/application/index.js +11 -0
  65. package/src/application/micro-application.vue +56 -0
  66. package/src/constants/index.js +0 -0
  67. package/src/hooks/index.js +9 -0
  68. package/src/hooks/use-data-form/index.js +24 -0
  69. package/src/hooks/use-data-table/index.js +22 -0
  70. package/src/hooks/use-data-table-page/index.js +48 -0
  71. package/src/hooks/use-event-dispatcher/index.js +15 -0
  72. package/src/hooks/use-global-config/index.js +49 -0
  73. package/src/hooks/use-keydown/index.js +2 -0
  74. package/src/hooks/use-keydown/use-keydown.js +35 -0
  75. package/src/hooks/use-keydown/use-save-keydown.js +13 -0
  76. package/src/hooks/use-namespace/index.js +90 -0
  77. package/src/hooks/use-service/index.js +15 -0
  78. package/src/hooks/use-value/index.js +15 -0
  79. package/src/index.js +8 -0
  80. package/src/interceptors/RequestInterceptors.js +46 -0
  81. package/src/interceptors/RouterInterceptors.js +47 -0
  82. package/src/interceptors/index.js +2 -0
  83. package/src/ioc/ReactiveInstantiationService.js +29 -0
  84. package/src/ioc/index.js +1 -0
  85. package/src/utils/index.js +1 -0
  86. package/src/utils/pageDataParser.js +27 -0
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <div v-once ref="el" :class="ns.b('mcrio')"></div>
3
+ </template>
4
+
5
+ <script setup>
6
+ import { computed, onBeforeUnmount, onMounted, ref } from 'vue';
7
+ import { applicationKey } from '@ctzy-web-client/tokens';
8
+ import { useGlobalConfig, useNamespace } from '../hooks';
9
+
10
+ defineOptions({
11
+ name: 'BwaMcrioApplication',
12
+ });
13
+
14
+ const props = defineProps({
15
+ name: {
16
+ type: String,
17
+ required: true,
18
+ },
19
+ entry: {
20
+ type: String,
21
+ required: true,
22
+ },
23
+ extendOptions: {
24
+ type: Object,
25
+ },
26
+ });
27
+
28
+ const ns = useNamespace('application');
29
+ const application = useGlobalConfig(applicationKey);
30
+
31
+ /** @type {import("vue").Ref<HTMLElement>} */
32
+ const el = ref(null);
33
+
34
+ const microApplication = computed(
35
+ () =>
36
+ application.value.getMicroApplication(props.name) ||
37
+ application.value.createMicroApplication({
38
+ name: props.name,
39
+ entry: props.entry,
40
+ extendOptions: props.extendOptions,
41
+ })
42
+ );
43
+
44
+ const mountApplicationPromise = microApplication.value.mountApplication();
45
+
46
+ onMounted(() => {
47
+ el.value.appendChild(microApplication.value.container);
48
+ });
49
+
50
+ onBeforeUnmount(() => {
51
+ el.value.removeChild(microApplication.value.container);
52
+ microApplication.value.unmountApplication();
53
+ });
54
+
55
+ await mountApplicationPromise;
56
+ </script>
File without changes
@@ -0,0 +1,9 @@
1
+ export * from './use-global-config';
2
+ export * from './use-namespace';
3
+ export * from './use-data-form';
4
+ export * from './use-data-table';
5
+ export * from './use-service';
6
+ export * from './use-value';
7
+ export * from './use-keydown';
8
+ export * from './use-event-dispatcher';
9
+ export * from './use-data-table-page';
@@ -0,0 +1,24 @@
1
+ import { ref } from 'vue';
2
+ import { DataForm } from '@ctzy-web-client/data-model';
3
+ import { applicationKey } from '@ctzy-web-client/tokens';
4
+ import { useGlobalConfig } from '../use-global-config';
5
+
6
+ /**
7
+ * 创建数据表单
8
+ * @template T
9
+ * @param {T} dataForm datamodel类定义或者 DataForm 实例
10
+ * @param {object} options
11
+ * @returns {import('vue').InjectionKey<DataForm>} data form
12
+ */
13
+ export const useDataForm = (model, options = {}) => {
14
+ const application = useGlobalConfig(applicationKey);
15
+ const dataForm = ref(
16
+ application.value.createInstance(DataForm, {
17
+ args: [{ model, ...options }],
18
+ })
19
+ );
20
+
21
+ dataForm.value.init();
22
+
23
+ return dataForm;
24
+ };
@@ -0,0 +1,22 @@
1
+ import { ref } from 'vue';
2
+ import { DataTable } from '@ctzy-web-client/data-model';
3
+ import { applicationKey } from '@ctzy-web-client/tokens';
4
+ import { useGlobalConfig } from '../use-global-config';
5
+
6
+ /**
7
+ * 创建数据表格
8
+ * @template T
9
+ * @param {T} model datamodel类定义或者DataTable实例
10
+ * @param {object} options
11
+ * @returns {import("vue").Ref<DataTable>} data table
12
+ */
13
+ export const useDataTable = (model, options = {}) => {
14
+ const application = useGlobalConfig(applicationKey);
15
+ const dataTable = ref(
16
+ application.value.createInstance(DataTable, { args: [{ model, ...options }] })
17
+ );
18
+
19
+ dataTable.value.init();
20
+
21
+ return dataTable;
22
+ };
@@ -0,0 +1,48 @@
1
+ import { unref } from 'vue';
2
+ import { useRoute, useRouter } from 'vue-router';
3
+ import { useEventDispatcher } from '../use-event-dispatcher';
4
+
5
+ export const useDataTablePage = (dataTable, options = {}) => {
6
+ options = { ...options };
7
+ options.currentPage = options.currentPage || 'currentPage';
8
+ options.pageSize = options.pageSize || 'pageSize';
9
+
10
+ const router = useRouter();
11
+ const route = useRoute();
12
+
13
+ let {
14
+ currentPage = unref(dataTable).pageNum,
15
+ pageSize = unref(dataTable).pageSize,
16
+ } = unref(route).query;
17
+
18
+ currentPage = parseInt(currentPage);
19
+ pageSize = parseInt(pageSize);
20
+ if (isNaN(currentPage)) {
21
+ currentPage = unref(dataTable).pageNum;
22
+ }
23
+ if (isNaN(pageSize)) {
24
+ pageSize = unref(dataTable).pageSize;
25
+ }
26
+
27
+ unref(dataTable).pageNum = currentPage;
28
+ unref(dataTable).pageSize = pageSize;
29
+
30
+ useEventDispatcher(dataTable, 'current-page-change', (currentPage) => {
31
+ const query = unref(router.currentRoute).query;
32
+ router.replace({
33
+ query: {
34
+ ...query,
35
+ currentPage,
36
+ },
37
+ });
38
+ });
39
+ useEventDispatcher(dataTable, 'page-size-change', (pageSize) => {
40
+ const query = unref(router.currentRoute).query;
41
+ router.replace({
42
+ query: {
43
+ ...query,
44
+ pageSize,
45
+ },
46
+ });
47
+ });
48
+ };
@@ -0,0 +1,15 @@
1
+ import { onMounted, onUnmounted, unref } from 'vue';
2
+
3
+ export const useEventDispatcher = (eventDispatcher, eventName, handler) => {
4
+ onMounted(() => {
5
+ unref(eventDispatcher).on(eventName, handler);
6
+ });
7
+
8
+ const off = () => {
9
+ unref(eventDispatcher).off(eventName, handler);
10
+ };
11
+
12
+ onUnmounted(off);
13
+
14
+ return off;
15
+ };
@@ -0,0 +1,49 @@
1
+ import { computed, getCurrentInstance, inject, ref, unref, provide } from 'vue';
2
+ import { configProviderContextKey } from '@ctzy-web-client/tokens';
3
+
4
+ const globalConfig = ref();
5
+
6
+ export function useGlobalConfig(key, defaultValue) {
7
+ const config = getCurrentInstance()
8
+ ? inject(configProviderContextKey, globalConfig)
9
+ : globalConfig;
10
+
11
+ if (key) {
12
+ return computed(() => config.value?.[key] ?? defaultValue);
13
+ } else {
14
+ return config;
15
+ }
16
+ }
17
+
18
+ export const provideGlobalConfig = (config, app, global = false) => {
19
+ const inSetup = !!getCurrentInstance();
20
+ const oldConfig = inSetup ? useGlobalConfig() : undefined;
21
+ const provideFn = app?.provide ?? (inSetup ? provide : undefined);
22
+ if (!provideFn) {
23
+ console.warn(
24
+ 'provideGlobalConfig',
25
+ 'provideGlobalConfig() can only be used inside setup().'
26
+ );
27
+ return;
28
+ }
29
+
30
+ const context = computed(() => {
31
+ const cfg = unref(config);
32
+ if (!oldConfig?.value) return cfg;
33
+ return mergeConfig(oldConfig.value, cfg);
34
+ });
35
+ provideFn(configProviderContextKey, context);
36
+ if (global || !globalConfig.value) {
37
+ globalConfig.value = context.value;
38
+ }
39
+ return context;
40
+ };
41
+
42
+ const mergeConfig = (a, b) => {
43
+ const keys = [...new Set([...Reflect.ownKeys(a), ...Reflect.ownKeys(b)])];
44
+ const obj = {};
45
+ for (const key of keys) {
46
+ obj[key] = b[key] ?? a[key];
47
+ }
48
+ return obj;
49
+ };
@@ -0,0 +1,2 @@
1
+ export * from './use-keydown';
2
+ export * from './use-save-keydown';
@@ -0,0 +1,35 @@
1
+ import { onBeforeUnmount, onMounted } from 'vue';
2
+
3
+ let registeredHandlers = [];
4
+
5
+ /**
6
+ *
7
+ * @param {KeyboardEvent} event
8
+ */
9
+ const cacchedHandler = (event) => {
10
+ for (let registeredHandler of registeredHandlers) {
11
+ registeredHandler(event);
12
+ }
13
+ };
14
+
15
+ /**
16
+ * @param {(event: KeyboardEvent) => void} handler
17
+ */
18
+ export const useKeydown = (handler) => {
19
+ onMounted(() => {
20
+ if (!registeredHandlers.length) {
21
+ document.addEventListener('keydown', cacchedHandler);
22
+ }
23
+ registeredHandlers.push(handler);
24
+ });
25
+
26
+ onBeforeUnmount(() => {
27
+ registeredHandlers = registeredHandlers.filter(
28
+ (registeredHandler) => registeredHandler !== handler
29
+ );
30
+
31
+ if (!registeredHandlers.length) {
32
+ document.removeEventListener('keydown', cacchedHandler);
33
+ }
34
+ });
35
+ };
@@ -0,0 +1,13 @@
1
+ import { useKeydown } from './use-keydown';
2
+
3
+ export const useSaveKeydown = (handler) => {
4
+ useKeydown((event) => {
5
+ if (
6
+ event.key.toLocaleLowerCase() === 's' &&
7
+ (event.ctrlKey || event.metaKey)
8
+ ) {
9
+ event.preventDefault();
10
+ handler(event);
11
+ }
12
+ });
13
+ };
@@ -0,0 +1,90 @@
1
+ import { useGlobalConfig } from '../use-global-config';
2
+
3
+ export const defaultNamespace = 'web';
4
+ const statePrefix = 'is-';
5
+
6
+ const _bem = (namespace, block, blockSuffix, element, modifier) => {
7
+ let cls = `${namespace}-${block}`;
8
+ if (blockSuffix) {
9
+ cls += `-${blockSuffix}`;
10
+ }
11
+ if (element) {
12
+ cls += `__${element}`;
13
+ }
14
+ if (modifier) {
15
+ cls += `--${modifier}`;
16
+ }
17
+ return cls;
18
+ };
19
+
20
+ export const useNamespace = (block) => {
21
+ const namespace = useGlobalConfig('namespace', defaultNamespace);
22
+ const b = (blockSuffix = '') =>
23
+ _bem(namespace.value, block, blockSuffix, '', '');
24
+ const e = (element) =>
25
+ element ? _bem(namespace.value, block, '', element, '') : '';
26
+ const m = (modifier) =>
27
+ modifier ? _bem(namespace.value, block, '', '', modifier) : '';
28
+ const be = (blockSuffix, element) =>
29
+ blockSuffix && element
30
+ ? _bem(namespace.value, block, blockSuffix, element, '')
31
+ : '';
32
+ const em = (element, modifier) =>
33
+ element && modifier
34
+ ? _bem(namespace.value, block, '', element, modifier)
35
+ : '';
36
+ const bm = (blockSuffix, modifier) =>
37
+ blockSuffix && modifier
38
+ ? _bem(namespace.value, block, blockSuffix, '', modifier)
39
+ : '';
40
+ const bem = (blockSuffix, element, modifier) =>
41
+ blockSuffix && element && modifier
42
+ ? _bem(namespace.value, block, blockSuffix, element, modifier)
43
+ : '';
44
+ const is = (name, ...args) => {
45
+ const state = args.length >= 1 ? args[0] : true;
46
+ return name && state ? `${statePrefix}${name}` : '';
47
+ };
48
+
49
+ // for css var
50
+ // --el-xxx: value;
51
+ const cssVar = (object) => {
52
+ const styles = {};
53
+ for (const key in object) {
54
+ if (object[key]) {
55
+ styles[`--${namespace.value}-${key}`] = object[key];
56
+ }
57
+ }
58
+ return styles;
59
+ };
60
+ // with block
61
+ const cssVarBlock = (object) => {
62
+ const styles = {};
63
+ for (const key in object) {
64
+ if (object[key]) {
65
+ styles[`--${namespace.value}-${block}-${key}`] = object[key];
66
+ }
67
+ }
68
+ return styles;
69
+ };
70
+
71
+ const cssVarName = (name) => `--${namespace.value}-${name}`;
72
+ const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
73
+
74
+ return {
75
+ namespace,
76
+ b,
77
+ e,
78
+ m,
79
+ be,
80
+ em,
81
+ bm,
82
+ bem,
83
+ is,
84
+ // css
85
+ cssVar,
86
+ cssVarName,
87
+ cssVarBlock,
88
+ cssVarBlockName,
89
+ };
90
+ };
@@ -0,0 +1,15 @@
1
+ import { computed } from 'vue';
2
+ import { applicationKey } from '@ctzy-web-client/tokens';
3
+ import { useGlobalConfig } from '../use-global-config';
4
+
5
+ /**
6
+ * 根据recid请求一条实例填充到模型
7
+ * @template T
8
+ * @param {T} key 模型定义
9
+ * @returns {InstanceType<T>}
10
+ */
11
+ export const useService = function (key) {
12
+ return computed(() =>
13
+ useGlobalConfig(applicationKey).value.getIocContainer().getService(key)
14
+ );
15
+ };
@@ -0,0 +1,15 @@
1
+ import { computed } from 'vue';
2
+ import { applicationKey } from '@ctzy-web-client/tokens';
3
+ import { useGlobalConfig } from '../use-global-config';
4
+
5
+ /**
6
+ * 根据recid请求一条实例填充到模型
7
+ * @template T
8
+ * @param {T} key 模型定义
9
+ * @returns {InstanceType<T>}
10
+ */
11
+ export const useValue = function (key) {
12
+ return computed(() =>
13
+ useGlobalConfig(applicationKey).value.getIocContainer().getValue(key)
14
+ );
15
+ };
package/src/index.js ADDED
@@ -0,0 +1,8 @@
1
+ export * from './interceptors';
2
+ export * from './application';
3
+ export * from './hooks';
4
+
5
+ export * from '@ctzy-web-client/data-model';
6
+ export * from '@ctzy-web-client/ioc';
7
+ export * from '@ctzy-web-client/support';
8
+ export * from '@ctzy-web-client/tokens';
@@ -0,0 +1,46 @@
1
+ export class RequestInterceptors {
2
+ /**
3
+ * 请求发起的处理程序
4
+ * @param {Object} config 请求配置
5
+ * @returns
6
+ */
7
+ request(config) {
8
+ return config;
9
+ }
10
+
11
+ /**
12
+ * 处理请求发起的错误
13
+ * @param {Error} e 错误
14
+ */
15
+ requestError(e) {
16
+ return Promise.reject(new Error('请求错误'));
17
+ }
18
+
19
+ /**
20
+ * 响应处理程序
21
+ * @param {Object} response 响应对象
22
+ * @param {Object} response.config 请求配置
23
+ * @param {Object} response.data 请求结果
24
+ * @param {Number} response.status 请求状态
25
+ * @param {String} response.statusText 请求状态描述
26
+ * @param {Object} response.request 请求对象
27
+ * @returns
28
+ */
29
+ response(response) {
30
+ let { data, status, statusText } = response;
31
+
32
+ if (status === 200) {
33
+ return data;
34
+ } else {
35
+ throw new Error(`请求异常:[${status}] ${statusText}`);
36
+ }
37
+ }
38
+
39
+ /**
40
+ * 处理系统级别响应错误 404 等等
41
+ * @param {Error} e 错误
42
+ */
43
+ responseError(e) {
44
+ return Promise.reject(new Error('请求错误'));
45
+ }
46
+ }
@@ -0,0 +1,47 @@
1
+ import { inject } from '@ctzy-web-client/ioc-annotations';
2
+
3
+ export class RouterInterceptors {
4
+ @inject('Application')
5
+ application = null;
6
+
7
+ async needWaitRouteLoad(to) {
8
+ if (!to.matched.length && this.application._resolveRoutesPromise) {
9
+ await this.application._resolveRoutesPromise;
10
+ return true;
11
+ }
12
+
13
+ return false;
14
+ }
15
+
16
+ /**
17
+ * 设置一个导航钩子,在每次导航后执行。
18
+ * @param {*} to 我们要导航到的路由地址
19
+ * @param {*} from 我们从哪里来的路由地址
20
+ * @param {*} failure next (可选) - 回调以验证导航
21
+ */
22
+ afterEach(to, from, failure) {}
23
+
24
+ /**
25
+ * 设置一个导航守卫,在任何导航前执行。
26
+ * @param {*} to 我们要导航到的路由地址
27
+ * @param {*} from 我们从哪里来的路由地址
28
+ * @param {*} next next (可选) - 回调以验证导航
29
+ */
30
+ async beforeEach(to, from, next) {
31
+ if (await this.needWaitRouteLoad(to)) {
32
+ return next(to);
33
+ }
34
+
35
+ return next();
36
+ }
37
+
38
+ /**
39
+ * 设置一个导航守卫,在导航即将解析之前执行。在这个状态下,所有的组件都已经被获取,并且其他导航守卫也已经成功。
40
+ * @param {*} to 我们要导航到的路由地址
41
+ * @param {*} from 我们从哪里来的路由地址
42
+ * @param {*} next next (可选) - 回调以验证导航
43
+ */
44
+ beforeResolve(to, from, next) {
45
+ return next();
46
+ }
47
+ }
@@ -0,0 +1,2 @@
1
+ export * from './RequestInterceptors';
2
+ export * from './RouterInterceptors';
@@ -0,0 +1,29 @@
1
+ import { reactive, ref } from 'vue';
2
+ import { InstantiationService } from '@ctzy-web-client/ioc';
3
+
4
+ /**
5
+ * 服务工厂
6
+ */
7
+ export class ReactiveInstantiationService extends InstantiationService {
8
+ /**
9
+ * 创建实例
10
+ * @template T
11
+ * @param {T} Clazz
12
+ * @param {Object} option 服务注册配置项
13
+ * @param {Boolean} option.reactive 是否创建响应对象
14
+ * @param {Boolean} option.overwrite 是否允许覆盖 默认不允许
15
+ * @param {String} option.type 注入的类型 function|class 主要是js编译成es5的代码时无法针对函数和类做区分
16
+ * @returns {InstanceType<T>}
17
+ */
18
+ createInstance(Clazz, option) {
19
+ let instance = super.createInstance(Clazz, option);
20
+
21
+ //创建实例
22
+ if (option?.reactive) {
23
+ instance = reactive(instance);
24
+ // return typeof instance == 'object' ? reactive(instance) : ref(instance);
25
+ }
26
+
27
+ return instance;
28
+ }
29
+ }
@@ -0,0 +1 @@
1
+ export * from './ReactiveInstantiationService';
@@ -0,0 +1 @@
1
+ export * from './pageDataParser';
@@ -0,0 +1,27 @@
1
+ /**
2
+ * 解析页面数据
3
+ * @param {Array<Object>|Object} pages 注册的页面
4
+ */
5
+ export const pageDataParser = async function (pages) {
6
+ //找页面
7
+ if (typeof pages == 'object') {
8
+ const pageModules = await Promise.all(
9
+ Object.keys(pages).map((path) => pages[path]())
10
+ );
11
+
12
+ return pageModules.map((module) => {
13
+ module.default.inheritAttrs = false;
14
+ return {
15
+ parent: module.parent,
16
+ meta: module.meta,
17
+ route: module.route,
18
+ name: module.name || module.default.name,
19
+ component: module.default,
20
+ redirect: module.redirect,
21
+ props: module.props,
22
+ };
23
+ });
24
+ } else {
25
+ pageDeifnes.push(...pages);
26
+ }
27
+ };