create-pubinfo 2.0.0-rc.4 → 2.0.0-rc.5
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/dist/index.js +199 -148
- package/package.json +5 -1
- package/templates/{pubinfo-template → pubinfo-app}/.env +0 -3
- package/templates/{pubinfo-template/openapi.config.ts → pubinfo-app/openapi.config.ts.hbs} +1 -1
- package/templates/{pubinfo-template/package.json → pubinfo-app/package.json.hbs} +8 -4
- package/templates/pubinfo-app/src/settings.ts.hbs +8 -0
- package/templates/pubinfo-module/.editorconfig +10 -0
- package/templates/pubinfo-module/README.md.hbs +27 -0
- package/templates/pubinfo-module/_gitignore +38 -0
- package/templates/pubinfo-module/_npmrc +5 -0
- package/templates/pubinfo-module/eslint.config.ts +3 -0
- package/templates/pubinfo-module/package.json.hbs +67 -0
- package/templates/pubinfo-module/playground/.env +2 -0
- package/templates/pubinfo-module/playground/.env.development +6 -0
- package/templates/pubinfo-module/playground/.env.production +10 -0
- package/templates/pubinfo-module/playground/index.html +47 -0
- package/templates/pubinfo-module/playground/openapi.config.ts.hbs +33 -0
- package/templates/pubinfo-module/playground/package.json.hbs +22 -0
- package/templates/pubinfo-module/playground/pubinfo.config.ts +9 -0
- package/templates/pubinfo-module/playground/public/browser_upgrade/chrome.png +0 -0
- package/templates/pubinfo-module/playground/public/browser_upgrade/edge.png +0 -0
- package/templates/pubinfo-module/playground/public/browser_upgrade/index.css +49 -0
- package/templates/pubinfo-module/playground/public/loading.css +92 -0
- package/templates/pubinfo-module/playground/src/App.vue +7 -0
- package/templates/pubinfo-module/playground/src/api/modules/auth/index.ts +3 -0
- package/templates/pubinfo-module/playground/src/api/modules/auth/renzhengfuwu.ts +145 -0
- package/templates/pubinfo-module/playground/src/api/modules/auth/typings.d.ts +97 -0
- package/templates/pubinfo-module/playground/src/api/request.ts +125 -0
- package/templates/pubinfo-module/playground/src/assets/icons/logo.svg +1 -0
- package/templates/pubinfo-module/playground/src/assets/icons/process-management.svg +1 -0
- package/templates/pubinfo-module/playground/src/assets/icons/workbench.svg +1 -0
- package/templates/pubinfo-module/playground/src/assets/images/login-bg.webp +0 -0
- package/templates/pubinfo-module/playground/src/assets/images/login-bg_dark.webp +0 -0
- package/templates/pubinfo-module/playground/src/assets/images/login-small.png +0 -0
- package/templates/pubinfo-module/playground/src/assets/images/login-small_dark.webp +0 -0
- package/templates/pubinfo-module/playground/src/components/UIProvider/index.vue +51 -0
- package/templates/pubinfo-module/playground/src/layouts/index.vue +44 -0
- package/templates/pubinfo-module/playground/src/main.ts.hbs +24 -0
- package/templates/pubinfo-module/playground/src/modules/auth.ts +20 -0
- package/templates/pubinfo-module/playground/src/modules/rbac.ts +10 -0
- package/templates/pubinfo-module/playground/src/routes/index.ts +71 -0
- package/templates/pubinfo-module/playground/src/routes/modules/demo/breadcrumb.example.ts +62 -0
- package/templates/pubinfo-module/playground/src/routes/modules/demo/link.ts +15 -0
- package/templates/pubinfo-module/playground/src/routes/modules/demo/multilevel.menu.example.ts +68 -0
- package/templates/pubinfo-module/playground/src/routes/modules/demo/other.page.ts +37 -0
- package/templates/pubinfo-module/playground/src/routes/modules/demo/single.ts +14 -0
- package/templates/{pubinfo-template → pubinfo-module/playground}/src/settings.ts +1 -1
- package/templates/pubinfo-module/playground/src/stores/index.ts +2 -0
- package/templates/pubinfo-module/playground/src/stores/modules/conter.ts +16 -0
- package/templates/pubinfo-module/playground/src/views/demo/breadcrumb_example/detail1.vue +11 -0
- package/templates/pubinfo-module/playground/src/views/demo/breadcrumb_example/detail2.vue +11 -0
- package/templates/pubinfo-module/playground/src/views/demo/breadcrumb_example/list1.vue +11 -0
- package/templates/pubinfo-module/playground/src/views/demo/breadcrumb_example/list2.vue +11 -0
- package/templates/pubinfo-module/playground/src/views/demo/multilevel_menu_example/level2/level3/page1.vue +11 -0
- package/templates/pubinfo-module/playground/src/views/demo/multilevel_menu_example/level2/level3/page2.vue +11 -0
- package/templates/pubinfo-module/playground/src/views/demo/multilevel_menu_example/level2/page.vue +11 -0
- package/templates/pubinfo-module/playground/src/views/demo/multilevel_menu_example/page.vue +11 -0
- package/templates/pubinfo-module/playground/src/views/demo/other_page/des.vue +13 -0
- package/templates/pubinfo-module/playground/src/views/demo/other_page/index.vue +25 -0
- package/templates/pubinfo-module/playground/src/views/demo/preview-empty/index.vue +17 -0
- package/templates/pubinfo-module/playground/src/views/demo/single/index.vue +13 -0
- package/templates/pubinfo-module/playground/src/views/system/index.vue +5 -0
- package/templates/pubinfo-module/playground/src/views/system/login/components/LoginForm.vue +29 -0
- package/templates/pubinfo-module/playground/src/views/system/login/components/LoginWithPhone.vue +213 -0
- package/templates/pubinfo-module/playground/src/views/system/login/components/PasswordLogin.vue +194 -0
- package/templates/pubinfo-module/playground/src/views/system/login/components/Savephone.vue +17 -0
- package/templates/pubinfo-module/playground/src/views/system/login/components/Useragreement.vue +26 -0
- package/templates/pubinfo-module/playground/src/views/system/login/composables.ts +84 -0
- package/templates/pubinfo-module/playground/src/views/system/login/index.vue +142 -0
- package/templates/pubinfo-module/playground/tsconfig.json +3 -0
- package/templates/pubinfo-module/playground/uno.config.ts +17 -0
- package/templates/pubinfo-module/pnpm-workspace.yaml +2 -0
- package/templates/pubinfo-module/pubinfo.config.ts.hbs +36 -0
- package/templates/pubinfo-module/src/index.ts.hbs +9 -0
- package/templates/pubinfo-module/src/pages/demo.vue +11 -0
- package/templates/pubinfo-module/stylelint.config.js +3 -0
- package/templates/pubinfo-module/tsconfig.json +16 -0
- package/templates/pubinfo-module/uno.config.ts +8 -0
- package/templates/{pubinfo-template → pubinfo-app}/.browserslistrc +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/.editorconfig +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/.env.development +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/.env.production +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/_gitignore +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/_npmrc +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/eslint.config.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/index.html +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/pubinfo.config.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/public/browser_upgrade/chrome.png +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/public/browser_upgrade/edge.png +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/public/browser_upgrade/index.css +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/public/loading.css +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/App.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/api/modules/auth/index.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/api/modules/auth/renzhengfuwu.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/api/modules/auth/typings.d.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/api/request.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/assets/icons/logo.svg +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/assets/icons/process-management.svg +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/assets/icons/workbench.svg +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/assets/images/login-bg.webp +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/assets/images/login-bg_dark.webp +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/assets/images/login-small.png +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/assets/images/login-small_dark.webp +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/components/UIProvider/index.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/layouts/index.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/main.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/modules/auth.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/modules/rbac.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/routes/index.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/routes/modules/demo/breadcrumb.example.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/routes/modules/demo/link.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/routes/modules/demo/multilevel.menu.example.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/routes/modules/demo/other.page.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/routes/modules/demo/single.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/stores/index.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/stores/modules/conter.ts +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/breadcrumb_example/detail1.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/breadcrumb_example/detail2.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/breadcrumb_example/list1.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/breadcrumb_example/list2.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/multilevel_menu_example/level2/level3/page1.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/multilevel_menu_example/level2/level3/page2.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/multilevel_menu_example/level2/page.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/multilevel_menu_example/page.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/other_page/des.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/other_page/index.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/preview-empty/index.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/demo/single/index.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/system/index.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/system/login/components/LoginForm.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/system/login/components/LoginWithPhone.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/system/login/components/PasswordLogin.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/system/login/components/Savephone.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/system/login/components/Useragreement.vue +0 -0
- package/templates/{pubinfo-template → pubinfo-app}/src/views/system/login/composables.ts +1 -1
- /package/templates/{pubinfo-template → pubinfo-app}/src/views/system/login/index.vue +0 -0
- /package/templates/{pubinfo-template → pubinfo-app}/stylelint.config.js +0 -0
- /package/templates/{pubinfo-template → pubinfo-app}/tsconfig.json +0 -0
- /package/templates/{pubinfo-template → pubinfo-app}/uno.config.ts +0 -0
|
Binary file
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { legacyLogicalPropertiesTransformer, theme } from 'ant-design-vue';
|
|
3
|
+
import zhCN from 'ant-design-vue/es/locale/zh_CN';
|
|
4
|
+
import dayjs from 'dayjs';
|
|
5
|
+
import { useTheme } from 'pubinfo';
|
|
6
|
+
import 'dayjs/locale/zh-cn';
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: 'UIProvider',
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
dayjs.locale('zh-cn');
|
|
13
|
+
|
|
14
|
+
function getContainer() {
|
|
15
|
+
return document.body;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { isDark } = useTheme();
|
|
19
|
+
|
|
20
|
+
const UILocales = computed(() => {
|
|
21
|
+
return zhCN;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const themeMode = computed(() => {
|
|
25
|
+
return isDark.value
|
|
26
|
+
? { algorithm: [theme.darkAlgorithm] }
|
|
27
|
+
: {};
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const themeConfig = computed(() => {
|
|
31
|
+
return Object.assign(
|
|
32
|
+
{ token: { wireframe: true } },
|
|
33
|
+
themeMode.value,
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<a-config-provider
|
|
40
|
+
:locale="UILocales"
|
|
41
|
+
:theme="themeConfig"
|
|
42
|
+
:get-popup-container="getContainer"
|
|
43
|
+
>
|
|
44
|
+
<a-style-provider hash-priority="high" :transformers="[legacyLogicalPropertiesTransformer]">
|
|
45
|
+
<a-app class="w-full h-full">
|
|
46
|
+
<slot />
|
|
47
|
+
<a-modal />
|
|
48
|
+
</a-app>
|
|
49
|
+
</a-style-provider>
|
|
50
|
+
</a-config-provider>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {
|
|
3
|
+
Copyright,
|
|
4
|
+
Layout,
|
|
5
|
+
Logo,
|
|
6
|
+
Tool,
|
|
7
|
+
Tools,
|
|
8
|
+
} from 'pubinfo';
|
|
9
|
+
|
|
10
|
+
const title = import.meta.env.VITE_APP_TITLE;
|
|
11
|
+
const dev = import.meta.env.DEV;
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<Layout.Provider :app-title="title" :is-dev="dev">
|
|
16
|
+
<Layout>
|
|
17
|
+
<template #header>
|
|
18
|
+
<Layout.Header>
|
|
19
|
+
<template #logo>
|
|
20
|
+
<Logo name="logo" />
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<template #tools>
|
|
24
|
+
<Tools>
|
|
25
|
+
<Tool.Fullscreen />
|
|
26
|
+
<Tool.PageReload />
|
|
27
|
+
<Tool.DarkModeToggle />
|
|
28
|
+
</Tools>
|
|
29
|
+
</template>
|
|
30
|
+
</Layout.Header>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<template #sidebar>
|
|
34
|
+
<Layout.Sidebar />
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<Layout.Content />
|
|
38
|
+
|
|
39
|
+
<template #footer>
|
|
40
|
+
<Copyright />
|
|
41
|
+
</template>
|
|
42
|
+
</Layout>
|
|
43
|
+
</Layout.Provider>
|
|
44
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createPubinfo } from 'pubinfo';
|
|
2
|
+
import { {{camelCase dir}} } from 'pubinfo-module-{{kebabCase dir}}';
|
|
3
|
+
import { auth, basic } from './api/request';
|
|
4
|
+
import App from './App.vue';
|
|
5
|
+
import { setupAuth } from './modules/auth';
|
|
6
|
+
import { setupRbac } from './modules/rbac';
|
|
7
|
+
import { constantRoutes } from './routes';
|
|
8
|
+
import './settings';
|
|
9
|
+
import 'uno.css';
|
|
10
|
+
|
|
11
|
+
createPubinfo({
|
|
12
|
+
app: App,
|
|
13
|
+
router: { routes: constantRoutes },
|
|
14
|
+
setup(ctx) {},
|
|
15
|
+
request: {
|
|
16
|
+
auth,
|
|
17
|
+
basic,
|
|
18
|
+
},
|
|
19
|
+
modules: [
|
|
20
|
+
setupAuth(),
|
|
21
|
+
setupRbac(),
|
|
22
|
+
{{camelCase dir}}(),
|
|
23
|
+
],
|
|
24
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { auth } from '@pubinfo/module-auth';
|
|
2
|
+
import FourA from '@pubinfo/module-auth/providers/4A';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 登录相关配置
|
|
6
|
+
*/
|
|
7
|
+
export function setupAuth() {
|
|
8
|
+
return auth({
|
|
9
|
+
baseURL: import.meta.env.VITE_APP_API_BASEURL,
|
|
10
|
+
providers: [
|
|
11
|
+
FourA({
|
|
12
|
+
// 4A client_id
|
|
13
|
+
clientId: '',
|
|
14
|
+
|
|
15
|
+
// 4A redirect_uri 需要配置为 `xxx/#/auth/4A` 的格式
|
|
16
|
+
redirectUri: '',
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineAsyncRoutes, defineSystemRoutes } from 'pubinfo';
|
|
2
|
+
import Login from '@/views/system/login/index.vue';
|
|
3
|
+
|
|
4
|
+
import Breadcrumb from './modules/demo/breadcrumb.example';
|
|
5
|
+
import Link from './modules/demo/link';
|
|
6
|
+
import MultilevelMenuExample from './modules/demo/multilevel.menu.example';
|
|
7
|
+
import OtherPage from './modules/demo/other.page';
|
|
8
|
+
import Single from './modules/demo/single';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* ========================================================================
|
|
12
|
+
* 本地路由(资源管理的类型配置成"应用")
|
|
13
|
+
*========================================================================*
|
|
14
|
+
*/
|
|
15
|
+
defineAsyncRoutes([
|
|
16
|
+
{
|
|
17
|
+
meta: {
|
|
18
|
+
title: '演示管理系统',
|
|
19
|
+
icon: 'workbench',
|
|
20
|
+
},
|
|
21
|
+
children: [
|
|
22
|
+
Single,
|
|
23
|
+
MultilevelMenuExample,
|
|
24
|
+
OtherPage,
|
|
25
|
+
Link,
|
|
26
|
+
Breadcrumb,
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
meta: {
|
|
31
|
+
title: '演示系统1',
|
|
32
|
+
icon: 'process-management',
|
|
33
|
+
isDev: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* ========================================================================
|
|
40
|
+
* 系统路由(包含布局)
|
|
41
|
+
*========================================================================*
|
|
42
|
+
*/
|
|
43
|
+
defineSystemRoutes([
|
|
44
|
+
{
|
|
45
|
+
path: '/',
|
|
46
|
+
name: 'Home',
|
|
47
|
+
component: () => import('@/views/system/index.vue'),
|
|
48
|
+
meta: {
|
|
49
|
+
title: '首页',
|
|
50
|
+
icon: 'i-ant-design:home-twotone',
|
|
51
|
+
breadcrumb: false,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
]);
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* ========================================================================
|
|
58
|
+
* 固定路由(默认路由)
|
|
59
|
+
*========================================================================*
|
|
60
|
+
*/
|
|
61
|
+
export const constantRoutes = [
|
|
62
|
+
{
|
|
63
|
+
path: '/login',
|
|
64
|
+
name: 'Login',
|
|
65
|
+
component: Login,
|
|
66
|
+
meta: {
|
|
67
|
+
whiteList: true,
|
|
68
|
+
title: '登录',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
];
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { RouteRecordRaw } from 'vue-router';
|
|
2
|
+
|
|
3
|
+
const routes: RouteRecordRaw = {
|
|
4
|
+
path: '/breadcrumb_example',
|
|
5
|
+
redirect: '/breadcrumb_example/list1',
|
|
6
|
+
name: 'breadcrumbExample',
|
|
7
|
+
meta: {
|
|
8
|
+
title: '面包屑导航',
|
|
9
|
+
icon: 'i-solar-confetti-minimalistic-bold',
|
|
10
|
+
},
|
|
11
|
+
children: [
|
|
12
|
+
{
|
|
13
|
+
path: 'list1',
|
|
14
|
+
name: 'breadcrumbExampleList1',
|
|
15
|
+
component: () => import('@/views/demo/breadcrumb_example/list1.vue'),
|
|
16
|
+
meta: {
|
|
17
|
+
title: '列表1(平级模式)',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
path: 'detail1',
|
|
22
|
+
name: 'breadcrumbExampleDetail1',
|
|
23
|
+
component: () => import('@/views/demo/breadcrumb_example/detail1.vue'),
|
|
24
|
+
meta: {
|
|
25
|
+
title: '详情1',
|
|
26
|
+
sidebar: false,
|
|
27
|
+
activeMenu: '/breadcrumb_example/list1',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
path: 'list2',
|
|
32
|
+
name: 'breadcrumbExampleList2',
|
|
33
|
+
redirect: '/breadcrumb_example/demo/list2',
|
|
34
|
+
meta: {
|
|
35
|
+
title: '列表2(层级模式)',
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
{
|
|
39
|
+
path: '',
|
|
40
|
+
component: () => import('@/views/demo/breadcrumb_example/list2.vue'),
|
|
41
|
+
meta: {
|
|
42
|
+
title: '列表2(层级模式)',
|
|
43
|
+
sidebar: false,
|
|
44
|
+
breadcrumb: false,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
path: 'detail2',
|
|
49
|
+
name: 'breadcrumbExampleDetail2',
|
|
50
|
+
component: () => import('@/views/demo/breadcrumb_example/detail2.vue'),
|
|
51
|
+
meta: {
|
|
52
|
+
title: '详情2',
|
|
53
|
+
sidebar: false,
|
|
54
|
+
activeMenu: '/breadcrumb_example/list2',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default routes;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RouteRecordRaw } from 'vue-router';
|
|
2
|
+
|
|
3
|
+
const routes: RouteRecordRaw = {
|
|
4
|
+
path: '/link',
|
|
5
|
+
name: 'Link',
|
|
6
|
+
redirect: '',
|
|
7
|
+
meta: {
|
|
8
|
+
title: '跳转路由',
|
|
9
|
+
singleMenu: true,
|
|
10
|
+
icon: 'i-solar-confetti-minimalistic-bold',
|
|
11
|
+
link: 'http://124.223.184.245:10000/docs/',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default routes;
|
package/templates/pubinfo-module/playground/src/routes/modules/demo/multilevel.menu.example.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { RouteRecordRaw } from 'vue-router';
|
|
2
|
+
|
|
3
|
+
const routes: RouteRecordRaw = {
|
|
4
|
+
path: '/multilevel_menu_example',
|
|
5
|
+
redirect: '/multilevel_menu_example/page',
|
|
6
|
+
name: 'multilevelMenuExample',
|
|
7
|
+
meta: {
|
|
8
|
+
title: '多级导航',
|
|
9
|
+
icon: 'i-heroicons-solid:menu-alt-3',
|
|
10
|
+
},
|
|
11
|
+
children: [
|
|
12
|
+
{
|
|
13
|
+
path: 'page',
|
|
14
|
+
name: 'multilevelMenuExample1',
|
|
15
|
+
component: () => import('@/views/demo/multilevel_menu_example/page.vue'),
|
|
16
|
+
meta: {
|
|
17
|
+
title: '导航1',
|
|
18
|
+
icon: 'i-heroicons-solid:menu-alt-3',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
path: 'level2',
|
|
23
|
+
name: 'multilevelMenuExample2',
|
|
24
|
+
redirect: '/multilevel_menu_example/level2/page',
|
|
25
|
+
meta: {
|
|
26
|
+
title: '导航2',
|
|
27
|
+
},
|
|
28
|
+
children: [
|
|
29
|
+
{
|
|
30
|
+
path: 'page',
|
|
31
|
+
name: 'multilevelMenuExample2-1',
|
|
32
|
+
component: () => import('@/views/demo/multilevel_menu_example/level2/page.vue'),
|
|
33
|
+
meta: {
|
|
34
|
+
title: '导航2-1',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
path: 'level3',
|
|
39
|
+
name: 'multilevelMenuExample2-2',
|
|
40
|
+
redirect: '/multilevel_menu_example/level2/level3/page1',
|
|
41
|
+
meta: {
|
|
42
|
+
title: '导航2-2',
|
|
43
|
+
},
|
|
44
|
+
children: [
|
|
45
|
+
{
|
|
46
|
+
path: 'page1',
|
|
47
|
+
name: 'multilevelMenuExample2-2-1',
|
|
48
|
+
component: () => import('@/views/demo/multilevel_menu_example/level2/level3/page1.vue'),
|
|
49
|
+
meta: {
|
|
50
|
+
title: '导航2-2-1',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
path: 'page2',
|
|
55
|
+
name: 'multilevelMenuExample2-2-2',
|
|
56
|
+
component: () => import('@/views/demo/multilevel_menu_example/level2/level3/page2.vue'),
|
|
57
|
+
meta: {
|
|
58
|
+
title: '导航2-2-2',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default routes;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { RouteRecordRaw } from 'vue-router';
|
|
2
|
+
|
|
3
|
+
const routes: RouteRecordRaw = {
|
|
4
|
+
path: '/other-page',
|
|
5
|
+
redirect: '/other-page/list',
|
|
6
|
+
name: 'OtherPage',
|
|
7
|
+
meta: {
|
|
8
|
+
title: '下探页面',
|
|
9
|
+
icon: 'i-solar-confetti-minimalistic-bold',
|
|
10
|
+
},
|
|
11
|
+
children: [
|
|
12
|
+
{
|
|
13
|
+
path: 'list',
|
|
14
|
+
name: 'OtherPageList',
|
|
15
|
+
component: () => import('@/views/demo/other_page/index.vue'),
|
|
16
|
+
meta: {
|
|
17
|
+
title: '列表页',
|
|
18
|
+
sidebar: false,
|
|
19
|
+
breadcrumb: false,
|
|
20
|
+
activeMenu: '/other-page',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
path: 'detail',
|
|
25
|
+
name: 'OtherPageDetail',
|
|
26
|
+
component: () => import('@/views/demo/other_page/des.vue'),
|
|
27
|
+
meta: {
|
|
28
|
+
title: '详情页',
|
|
29
|
+
sidebar: false,
|
|
30
|
+
breadcrumb: true,
|
|
31
|
+
activeMenu: '/other-page',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default routes;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RouteRecordRaw } from 'vue-router';
|
|
2
|
+
|
|
3
|
+
const routes: RouteRecordRaw = {
|
|
4
|
+
path: '/single',
|
|
5
|
+
component: () => import('@/views/demo/single/index.vue'),
|
|
6
|
+
name: 'Single',
|
|
7
|
+
meta: {
|
|
8
|
+
title: '单页面路由',
|
|
9
|
+
singleMenu: true,
|
|
10
|
+
icon: 'i-solar-confetti-minimalistic-bold',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default routes;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
import { computed, ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
export const useCounterStore = defineStore('counter', () => {
|
|
5
|
+
const count = ref(0);
|
|
6
|
+
const doubleCount = computed(() => count.value * 2);
|
|
7
|
+
function increment() {
|
|
8
|
+
count.value++;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return {
|
|
12
|
+
count,
|
|
13
|
+
doubleCount,
|
|
14
|
+
increment,
|
|
15
|
+
};
|
|
16
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { PageMain } from 'pubinfo';
|
|
3
|
+
|
|
4
|
+
defineOptions({
|
|
5
|
+
name: 'OtherPage',
|
|
6
|
+
});
|
|
7
|
+
/* =============================================
|
|
8
|
+
= 逻辑代码 =
|
|
9
|
+
============================================= */
|
|
10
|
+
const router = useRouter();
|
|
11
|
+
function jump() {
|
|
12
|
+
router.push({
|
|
13
|
+
name: 'OtherPageDetail',
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<PageMain>
|
|
20
|
+
列表页
|
|
21
|
+
<a-button type="primary" @click="jump">
|
|
22
|
+
点击跳转入详情页
|
|
23
|
+
</a-button>
|
|
24
|
+
</PageMain>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/* =============================================
|
|
3
|
+
= Vue SFC Options 配置 =
|
|
4
|
+
============================================= */
|
|
5
|
+
defineOptions({
|
|
6
|
+
name: 'PreviewEmpty',
|
|
7
|
+
});
|
|
8
|
+
/* =============================================
|
|
9
|
+
= 逻辑代码 =
|
|
10
|
+
============================================= */
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div>
|
|
15
|
+
空白展示页面
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useLoginTabs } from '../composables';
|
|
3
|
+
|
|
4
|
+
defineOptions({
|
|
5
|
+
name: 'LoginFrom',
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const { tabs, initialTab, changeActiveTab } = useLoginTabs();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="flex flex-col w-456px [background:transparent]">
|
|
13
|
+
<div class="flex flex-row overflow-hidden border border-solid border-[#e7e8e9] rounded-1">
|
|
14
|
+
<div
|
|
15
|
+
v-for="(tab, index) in tabs"
|
|
16
|
+
:key="tab.title"
|
|
17
|
+
class="flex flex-row items-center justify-center h-10 text-base cursor-pointer rounded"
|
|
18
|
+
:class="[initialTab === index ? 'text-[#2f6bff] bg-[#ecf1fd]' : 'text-[#8a8e92] ']"
|
|
19
|
+
:style="{ width: `${100 / tabs.length}%` }"
|
|
20
|
+
@click="changeActiveTab(index)"
|
|
21
|
+
>
|
|
22
|
+
{{ tab.title }}
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="relative min-h-350px">
|
|
26
|
+
<component :is="tabs[initialTab].component" :key="tabs[initialTab].title" :name="tabs[initialTab].title" />
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|