zova-ui-empty 5.0.279 → 5.0.280
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 +7 -6
- package/package.original.json +5 -5
- package/src/suite/a-demo/modules/a-demo/src/.metadata/index.ts +2 -2
- package/src/suite/a-home/modules/home-base/package.json +48 -0
- package/src/suite/a-home/modules/home-base/src/.metadata/index.ts +63 -0
- package/src/suite/a-home/modules/home-base/src/.metadata/this.ts +2 -0
- package/src/suite/a-home/modules/home-base/src/bean/bean.api.ts +63 -0
- package/src/suite/a-home/modules/home-base/src/bean/local.router.ts +18 -0
- package/src/suite/a-home/modules/home-base/src/bean/local.ssr.ts +25 -0
- package/src/suite/a-home/modules/home-base/src/bean/style.default.ts +18 -0
- package/src/suite/a-home/modules/home-base/src/bean/theme.default.ts +25 -0
- package/src/suite/a-home/modules/home-base/src/component/page/controller.ts +18 -0
- package/src/suite/a-home/modules/home-base/src/component/page/index.vue +13 -0
- package/src/suite/a-home/modules/home-base/src/component/page/render.tsx +12 -0
- package/src/suite/a-home/modules/home-base/src/component/page/style.ts +16 -0
- package/src/suite/a-home/modules/home-base/src/index.ts +2 -0
- package/src/suite/a-home/modules/home-base/src/monkey.ts +31 -0
- package/src/suite/a-home/modules/home-base/src/page/errorNotFound/controller.ts +7 -0
- package/src/suite/a-home/modules/home-base/src/page/errorNotFound/index.vue +11 -0
- package/src/suite/a-home/modules/home-base/src/page/errorNotFound/render.tsx +25 -0
- package/src/suite/a-home/modules/home-base/src/page/errorNotFound/style.ts +10 -0
- package/src/suite/a-home/modules/home-base/src/routes.ts +15 -0
- package/src/suite/a-home/modules/home-base/src/types.ts +17 -0
- package/src/suite/a-home/modules/home-index/src/.metadata/index.ts +1 -1
- package/src/suite/a-home/modules/home-pagesystem/src/.metadata/index.ts +1 -1
- package/src/suite/a-home/package.json +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-ui-empty",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.280",
|
|
4
4
|
"description": "A vue3 empty framework with ioc",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -55,12 +55,13 @@
|
|
|
55
55
|
"zova": "^5.0.204",
|
|
56
56
|
"zova-module-a-core": "^5.0.44",
|
|
57
57
|
"zova-module-a-demo": "^5.0.0",
|
|
58
|
-
"zova-module-a-model": "^5.0.
|
|
59
|
-
"zova-module-a-pinia": "^5.0.
|
|
60
|
-
"zova-module-a-router": "^5.0.
|
|
61
|
-
"zova-module-a-style": "^5.0.
|
|
58
|
+
"zova-module-a-model": "^5.0.26",
|
|
59
|
+
"zova-module-a-pinia": "^5.0.26",
|
|
60
|
+
"zova-module-a-router": "^5.0.61",
|
|
61
|
+
"zova-module-a-style": "^5.0.38",
|
|
62
62
|
"zova-module-a-tabs": "^5.0.20",
|
|
63
63
|
"zova-module-home-api": "^5.0.0",
|
|
64
|
+
"zova-module-home-base": "^5.0.0",
|
|
64
65
|
"zova-module-home-component": "^5.0.0",
|
|
65
66
|
"zova-module-home-icon": "^5.0.0",
|
|
66
67
|
"zova-module-home-index": "^5.0.0",
|
|
@@ -84,5 +85,5 @@
|
|
|
84
85
|
"zova-vite": "^1.0.169"
|
|
85
86
|
},
|
|
86
87
|
"license": "MIT",
|
|
87
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "b89efc4131f17bc884c12d2921ac69cda4b799e1"
|
|
88
89
|
}
|
package/package.original.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-ui-empty",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.279",
|
|
4
4
|
"description": "A vue3 empty framework with ioc",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typestyle": "^2.4.0",
|
|
46
46
|
"vue": "^3.5.6",
|
|
47
47
|
"zod": "^3.23.8",
|
|
48
|
-
"zova": "^5.0.
|
|
48
|
+
"zova": "^5.0.204"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@cabloy/lint": "^4.0.11",
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
"@types/node": "^20.14.2",
|
|
54
54
|
"@vitejs/plugin-vue": "^5.0.5",
|
|
55
55
|
"concurrently": "^8.2.2",
|
|
56
|
-
"quasar-app-extension-zova": "^1.1.
|
|
56
|
+
"quasar-app-extension-zova": "^1.1.167",
|
|
57
57
|
"sass": "^1.77.5",
|
|
58
58
|
"typescript": "^5.4.5",
|
|
59
59
|
"vite": "^5.3.1",
|
|
60
60
|
"vue-tsc": "^2.0.29",
|
|
61
|
-
"zova-vite": "^1.0.
|
|
61
|
+
"zova-vite": "^1.0.169"
|
|
62
62
|
},
|
|
63
63
|
"license": "MIT",
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "05d23697b757afe62aff4ff5de98a9babdd326e2"
|
|
65
65
|
}
|
|
@@ -21,8 +21,8 @@ export * from '../routes.js';
|
|
|
21
21
|
import 'zova';
|
|
22
22
|
declare module 'zova' {
|
|
23
23
|
export interface IPagePathRecord {
|
|
24
|
-
'/a/demo/component':
|
|
25
|
-
'/a/demo/state':
|
|
24
|
+
'/a/demo/component': undefined;
|
|
25
|
+
'/a/demo/state': undefined;
|
|
26
26
|
}
|
|
27
27
|
export interface IPageNameRecord {}
|
|
28
28
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zova-module-home-base",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"title": "home-base",
|
|
5
|
+
"zovaModule": {
|
|
6
|
+
"capabilities": {
|
|
7
|
+
"monkey": true
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"a-core": "5.0.0"
|
|
11
|
+
},
|
|
12
|
+
"bundle": {
|
|
13
|
+
"vendors": [
|
|
14
|
+
{
|
|
15
|
+
"match": [
|
|
16
|
+
"axios"
|
|
17
|
+
],
|
|
18
|
+
"output": "axios"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": [
|
|
27
|
+
"./src/index.ts",
|
|
28
|
+
"./dist/index.d.ts"
|
|
29
|
+
],
|
|
30
|
+
"import": "./src/index.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./*": "./*"
|
|
34
|
+
},
|
|
35
|
+
"description": "",
|
|
36
|
+
"keywords": [
|
|
37
|
+
"Zova Module"
|
|
38
|
+
],
|
|
39
|
+
"author": "",
|
|
40
|
+
"files": [
|
|
41
|
+
"mock",
|
|
42
|
+
"dist"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"axios": "^1.6.8"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** beans: begin */
|
|
2
|
+
export * from '../bean/bean.api.js';
|
|
3
|
+
export * from '../bean/style.default.js';
|
|
4
|
+
export * from '../bean/theme.default.js';
|
|
5
|
+
import { BeanApi } from '../bean/bean.api.js';
|
|
6
|
+
import { StyleDefault } from '../bean/style.default.js';
|
|
7
|
+
import { ThemeDefault } from '../bean/theme.default.js';
|
|
8
|
+
import 'zova';
|
|
9
|
+
declare module 'zova' {
|
|
10
|
+
export interface IBeanRecord {
|
|
11
|
+
'home-base.bean.api': BeanApi;
|
|
12
|
+
'home-base.style.default': StyleDefault;
|
|
13
|
+
'home-base.theme.default': ThemeDefault;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** beans: end */
|
|
17
|
+
/** components: begin */
|
|
18
|
+
export * as NSControllerPage from '../component/page/controller.js';
|
|
19
|
+
import * as NSControllerPage from '../component/page/controller.js';
|
|
20
|
+
import component_page from '../component/page/index.vue';
|
|
21
|
+
export const components = {
|
|
22
|
+
page: component_page,
|
|
23
|
+
};
|
|
24
|
+
import 'zova';
|
|
25
|
+
declare module 'zova' {
|
|
26
|
+
export interface IComponentRecord {
|
|
27
|
+
'home-base:page': NSControllerPage.ControllerPage;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/** components: end */
|
|
31
|
+
/** pages: begin */
|
|
32
|
+
export * as NSControllerPageErrorNotFound from '../page/errorNotFound/controller.js';
|
|
33
|
+
|
|
34
|
+
export * from '../routes.js';
|
|
35
|
+
|
|
36
|
+
import 'zova';
|
|
37
|
+
declare module 'zova' {
|
|
38
|
+
export interface IPagePathRecord {
|
|
39
|
+
'/home/base//:catchAll(.*)*': undefined;
|
|
40
|
+
}
|
|
41
|
+
export interface IPageNameRecord {}
|
|
42
|
+
}
|
|
43
|
+
export const pagePathSchemas = {};
|
|
44
|
+
export const pageNameSchemas = {};
|
|
45
|
+
/** pages: end */
|
|
46
|
+
/** monkey: begin */
|
|
47
|
+
export * from '../monkey.js';
|
|
48
|
+
/** monkey: end */
|
|
49
|
+
/** scope: begin */
|
|
50
|
+
import { BeanScopeBase, Scope, TypeModuleResource } from 'zova';
|
|
51
|
+
|
|
52
|
+
@Scope()
|
|
53
|
+
export class ScopeModuleHomeBase extends BeanScopeBase {}
|
|
54
|
+
|
|
55
|
+
export interface ScopeModuleHomeBase extends TypeModuleResource<typeof components, any, any, any, any, any> {}
|
|
56
|
+
|
|
57
|
+
import 'zova';
|
|
58
|
+
declare module 'zova' {
|
|
59
|
+
export interface IBeanScopeRecord {
|
|
60
|
+
'home-base': ScopeModuleHomeBase;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** scope: end */
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Bean, BeanBase, Use } from 'zova';
|
|
2
|
+
import axios, { AxiosInstance } from 'axios';
|
|
3
|
+
import { markRaw } from 'vue';
|
|
4
|
+
import type { ModelAuth } from 'zova-module-home-user';
|
|
5
|
+
|
|
6
|
+
const SymbolApi = Symbol('SymbolApi');
|
|
7
|
+
|
|
8
|
+
export interface BeanApi extends AxiosInstance {}
|
|
9
|
+
|
|
10
|
+
@Bean()
|
|
11
|
+
export class BeanApi extends BeanBase {
|
|
12
|
+
@Use('home-user.model.auth')
|
|
13
|
+
$$modelAuth: ModelAuth;
|
|
14
|
+
|
|
15
|
+
private [SymbolApi]: AxiosInstance;
|
|
16
|
+
|
|
17
|
+
protected async __init__() {
|
|
18
|
+
const baseURL = this.app.meta.util.getApiBaseURL();
|
|
19
|
+
this[SymbolApi] = markRaw(axios.create({ baseURL }));
|
|
20
|
+
this._addInterceptors(this[SymbolApi]);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
protected __get__(prop) {
|
|
24
|
+
return this[SymbolApi] && this[SymbolApi][prop];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private _addInterceptors(api: AxiosInstance) {
|
|
28
|
+
// request
|
|
29
|
+
api.interceptors.request.use(
|
|
30
|
+
config => {
|
|
31
|
+
if (this.app.config.base.jwt) {
|
|
32
|
+
config.headers.Authorization = `Bearer ${this.$$modelAuth.jwtAuthorization || ''}`;
|
|
33
|
+
}
|
|
34
|
+
return config;
|
|
35
|
+
},
|
|
36
|
+
error => {
|
|
37
|
+
return Promise.reject(error);
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
// response
|
|
41
|
+
api.interceptors.response.use(
|
|
42
|
+
response => {
|
|
43
|
+
const contentType = response.headers['content-type'];
|
|
44
|
+
if (!contentType || contentType.indexOf('application/json') === -1) return response;
|
|
45
|
+
if (response.data.code !== 0) {
|
|
46
|
+
const error = new Error();
|
|
47
|
+
error.code = response.data.code;
|
|
48
|
+
error.message = response.data.message;
|
|
49
|
+
return Promise.reject(error);
|
|
50
|
+
}
|
|
51
|
+
// return data
|
|
52
|
+
return response.data.data;
|
|
53
|
+
},
|
|
54
|
+
error => {
|
|
55
|
+
if (error.response) {
|
|
56
|
+
error.code = (error.response.data && error.response.data.code) || error.response.status;
|
|
57
|
+
error.message = (error.response.data && error.response.data.message) || error.response.statusText;
|
|
58
|
+
}
|
|
59
|
+
return Promise.reject(error);
|
|
60
|
+
},
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Local, Use } from 'zova';
|
|
2
|
+
import { ScopeModule } from '../.metadata/this.js';
|
|
3
|
+
import { BeanRouter, BeanRouterBase } from 'zova-module-a-router';
|
|
4
|
+
import type { ModelAuth } from 'zova-module-home-user';
|
|
5
|
+
|
|
6
|
+
@Local()
|
|
7
|
+
export class LocalRouter extends BeanRouterBase<ScopeModule> {
|
|
8
|
+
@Use('home-user.model.auth')
|
|
9
|
+
$$modelAuth: ModelAuth;
|
|
10
|
+
|
|
11
|
+
protected onRouterGuards(router: BeanRouter) {
|
|
12
|
+
router.beforeEach(async to => {
|
|
13
|
+
if (to.meta.requiresAuth !== false && !this.$$modelAuth.isAuthenticated) {
|
|
14
|
+
return '/login';
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BeanBase, Local } from 'zova';
|
|
2
|
+
import { ScopeModule } from '../.metadata/this.js';
|
|
3
|
+
|
|
4
|
+
@Local()
|
|
5
|
+
export class LocalSSR extends BeanBase<ScopeModule> {
|
|
6
|
+
public async initialize() {
|
|
7
|
+
// ssr hydrated
|
|
8
|
+
if (process.env.CLIENT) {
|
|
9
|
+
this.ctx.meta.ssr.onHydrated(() => {
|
|
10
|
+
// do something
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
// ssr theme
|
|
14
|
+
if (process.env.SERVER) {
|
|
15
|
+
this.ctx.meta.ssr.context.onRendered(() => {
|
|
16
|
+
if (!this.app.config.ssr.cookieThemeDark) {
|
|
17
|
+
this.ctx.meta.ssr.context._meta.bodyTags += `<script id="__prefersColorSchemeDarkJS">
|
|
18
|
+
document.body.setAttribute('data-theme', window.ssr_themedark_data);
|
|
19
|
+
document.querySelector('#__prefersColorSchemeDarkJS').remove();
|
|
20
|
+
</script>`.replaceAll('\n', '');
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BeanBase, Style, useComputed } from 'zova';
|
|
2
|
+
import { ScopeModule } from '../.metadata/this.js';
|
|
3
|
+
|
|
4
|
+
@Style()
|
|
5
|
+
export class StyleDefault extends BeanBase<ScopeModule> {
|
|
6
|
+
textCenter: string;
|
|
7
|
+
buttonPrimary: string;
|
|
8
|
+
|
|
9
|
+
protected async __init__() {
|
|
10
|
+
this.textCenter = this.$style({ textAlign: 'center' });
|
|
11
|
+
this.buttonPrimary = useComputed(() => {
|
|
12
|
+
return this.$style({
|
|
13
|
+
color: this.$token.color.primary,
|
|
14
|
+
borderColor: this.$token.var.borderColor,
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BeanBase, Theme } from 'zova';
|
|
2
|
+
import { ScopeModule } from '../.metadata/this.js';
|
|
3
|
+
import { ThemeApplyParams, ThemeApplyResult, ThemeBase } from 'zova-module-a-style';
|
|
4
|
+
import { ThemeToken } from 'zova-module-a-devui';
|
|
5
|
+
|
|
6
|
+
@Theme()
|
|
7
|
+
export class ThemeDefault extends BeanBase<ScopeModule> implements ThemeBase {
|
|
8
|
+
async apply({ name: _name, dark }: ThemeApplyParams): Promise<ThemeApplyResult> {
|
|
9
|
+
const token: ThemeToken = {
|
|
10
|
+
color: {
|
|
11
|
+
primary: '#1976d2',
|
|
12
|
+
},
|
|
13
|
+
var: {
|
|
14
|
+
borderColor: '#297acc',
|
|
15
|
+
},
|
|
16
|
+
component: {
|
|
17
|
+
page: {
|
|
18
|
+
background: dark ? '#121212' : '#fff',
|
|
19
|
+
color: dark ? '#fff' : '#000',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
return { token };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BeanControllerBase, Local, PropsBase } from 'zova';
|
|
2
|
+
import { ScopeModule } from '../../.metadata/this.js';
|
|
3
|
+
import { JSX } from 'vue/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
export interface Props extends PropsBase<ControllerPage, Slots> {}
|
|
6
|
+
|
|
7
|
+
export type Emits = {};
|
|
8
|
+
|
|
9
|
+
export interface Slots {
|
|
10
|
+
default?(): JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@Local()
|
|
14
|
+
export class ControllerPage extends BeanControllerBase<ScopeModule, Props, Emits, Slots> {
|
|
15
|
+
static $propsDefault = {};
|
|
16
|
+
|
|
17
|
+
protected async __init__() {}
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template></template>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import { useController } from 'zova';
|
|
7
|
+
import { ControllerPage, Props, Emits } from './controller.js';
|
|
8
|
+
import { RenderPage } from './render.jsx';
|
|
9
|
+
import { StylePage } from './style.js';
|
|
10
|
+
const props = withDefaults(defineProps<Props>(), ControllerPage.$propsDefault);
|
|
11
|
+
const emit = defineEmits<Emits>();
|
|
12
|
+
useController(props, emit, ControllerPage, RenderPage, StylePage);
|
|
13
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BeanRenderBase, Local } from 'zova';
|
|
2
|
+
import type { StylePage } from './style.js';
|
|
3
|
+
import { ScopeModule } from '../../.metadata/this.js';
|
|
4
|
+
|
|
5
|
+
export interface RenderPage extends StylePage {}
|
|
6
|
+
|
|
7
|
+
@Local()
|
|
8
|
+
export class RenderPage extends BeanRenderBase<ScopeModule> {
|
|
9
|
+
render() {
|
|
10
|
+
return <div class={this.cPage}>{this.$slots.default?.()}</div>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BeanStyleBase, Local } from 'zova';
|
|
2
|
+
import type { ControllerPage } from './controller.js';
|
|
3
|
+
import { ScopeModule } from '../../.metadata/this.js';
|
|
4
|
+
|
|
5
|
+
export interface StylePage extends ControllerPage {}
|
|
6
|
+
|
|
7
|
+
@Local()
|
|
8
|
+
export class StylePage extends BeanStyleBase<ScopeModule> {
|
|
9
|
+
cPage: string;
|
|
10
|
+
|
|
11
|
+
protected async __init__() {
|
|
12
|
+
this.cPage = this.$style({
|
|
13
|
+
padding: '16px',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BeanBase, BeanContainer, BeanSimple, IMonkeyAppInitialize, IMonkeyBeanInit } from 'zova';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { BeanApi } from './bean/bean.api.js';
|
|
4
|
+
import { LocalRouter } from './bean/local.router.js';
|
|
5
|
+
import { LocalSSR } from './bean/local.ssr.js';
|
|
6
|
+
|
|
7
|
+
export class Monkey extends BeanSimple implements IMonkeyAppInitialize, IMonkeyBeanInit {
|
|
8
|
+
localRouter: LocalRouter;
|
|
9
|
+
localSSR: LocalSSR;
|
|
10
|
+
|
|
11
|
+
async appInitialize() {
|
|
12
|
+
// api
|
|
13
|
+
this.app.meta.$axios = axios;
|
|
14
|
+
this.app.meta.$api = (await this.bean._getBean('home-base.bean.api', false)) as BeanApi;
|
|
15
|
+
// router
|
|
16
|
+
this.localRouter = await this.bean._newBean(LocalRouter, false);
|
|
17
|
+
// ssr
|
|
18
|
+
this.localSSR = await this.bean._newBean(LocalSSR, false);
|
|
19
|
+
await this.localSSR.initialize();
|
|
20
|
+
}
|
|
21
|
+
async beanInit(bean: BeanContainer, beanInstance: BeanBase) {
|
|
22
|
+
const self = this;
|
|
23
|
+
bean.defineProperty(beanInstance, '$api', {
|
|
24
|
+
enumerable: false,
|
|
25
|
+
configurable: true,
|
|
26
|
+
get() {
|
|
27
|
+
return self.app.meta.$api;
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<template></template>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup lang="ts">
|
|
6
|
+
import { useControllerPage } from 'zova';
|
|
7
|
+
import { ControllerPageErrorNotFound } from './controller.js';
|
|
8
|
+
import { RenderErrorNotFound } from './render.jsx';
|
|
9
|
+
import { StyleErrorNotFound } from './style.js';
|
|
10
|
+
useControllerPage(ControllerPageErrorNotFound, RenderErrorNotFound, StyleErrorNotFound);
|
|
11
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BeanRenderBase, Local } from 'zova';
|
|
2
|
+
import type { StyleErrorNotFound } from './style.js';
|
|
3
|
+
import { ScopeModule } from '../../.metadata/this.js';
|
|
4
|
+
import { RouterLink } from 'vue-router';
|
|
5
|
+
|
|
6
|
+
export interface RenderErrorNotFound extends StyleErrorNotFound {}
|
|
7
|
+
|
|
8
|
+
@Local()
|
|
9
|
+
export class RenderErrorNotFound extends BeanRenderBase<ScopeModule> {
|
|
10
|
+
render() {
|
|
11
|
+
return (
|
|
12
|
+
<div class="fill-height bg-blue text-white text-center">
|
|
13
|
+
<div>
|
|
14
|
+
<div style="font-size: 30vh">404</div>
|
|
15
|
+
|
|
16
|
+
<div class="text-h2" style="opacity:.4">
|
|
17
|
+
Oops. Nothing here...
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<RouterLink to="/">Go Home</RouterLink>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BeanStyleBase, Local } from 'zova';
|
|
2
|
+
import type { ControllerPageErrorNotFound } from './controller.js';
|
|
3
|
+
import { ScopeModule } from '../../.metadata/this.js';
|
|
4
|
+
|
|
5
|
+
export interface StyleErrorNotFound extends ControllerPageErrorNotFound {}
|
|
6
|
+
|
|
7
|
+
@Local()
|
|
8
|
+
export class StyleErrorNotFound extends BeanStyleBase<ScopeModule> {
|
|
9
|
+
protected async __init__() {}
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import ErrorNotFound from './page/errorNotFound/index.vue';
|
|
2
|
+
import { IModuleRoute } from 'zova-module-a-router';
|
|
3
|
+
|
|
4
|
+
export const routes: IModuleRoute[] = [
|
|
5
|
+
{
|
|
6
|
+
path: '/:catchAll(.*)*',
|
|
7
|
+
component: ErrorNotFound,
|
|
8
|
+
meta: {
|
|
9
|
+
absolute: true,
|
|
10
|
+
layout: 'empty',
|
|
11
|
+
requiresAuth: false,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
{ path: 'errorNotFound', component: ErrorNotFound },
|
|
15
|
+
];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { BeanApi } from './bean/bean.api.js';
|
|
3
|
+
import { StyleDefault } from './bean/style.default.js';
|
|
4
|
+
import { components } from './.metadata/index.js';
|
|
5
|
+
import 'zova';
|
|
6
|
+
|
|
7
|
+
declare module 'zova' {
|
|
8
|
+
export interface AppMeta {
|
|
9
|
+
$axios: AxiosInstance;
|
|
10
|
+
$api: BeanApi;
|
|
11
|
+
}
|
|
12
|
+
export interface BeanBase {
|
|
13
|
+
$api: BeanApi;
|
|
14
|
+
$class: StyleDefault;
|
|
15
|
+
$component: typeof components;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"zova-module-home-layout": "workspace:^",
|
|
13
13
|
"zova-module-home-router": "workspace:^",
|
|
14
14
|
"zova-module-home-api": "workspace:^",
|
|
15
|
-
"zova-module-home-component": "workspace:^"
|
|
15
|
+
"zova-module-home-component": "workspace:^",
|
|
16
|
+
"zova-module-home-base": "workspace:^"
|
|
16
17
|
}
|
|
17
18
|
}
|