@moluoxixi/create-app 2.0.1 → 2.0.402
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/LICENSE.txt +21 -21
- package/README.md +129 -129
- package/dist/commands/create.d.ts +2 -1
- package/dist/commands/create.js +12 -8
- package/dist/commands/index.d.ts +1 -2
- package/dist/commands/index.js +1 -2
- package/dist/constants/index.d.ts +17 -0
- package/dist/constants/index.js +17 -0
- package/dist/generators/index.d.ts +3 -4
- package/dist/generators/index.js +3 -4
- package/dist/generators/project.d.ts +3 -2
- package/dist/generators/project.js +5 -4
- package/dist/generators/react.d.ts +4 -2
- package/dist/generators/react.js +10 -30
- package/dist/generators/vue.d.ts +4 -2
- package/dist/generators/vue.js +10 -31
- package/dist/index.d.ts +0 -1
- package/dist/index.js +21 -3
- package/dist/test.d.ts +5 -2
- package/dist/test.js +252 -206
- package/dist/types/ejs.d.ts +0 -1
- package/dist/types/ejs.js +0 -1
- package/dist/types/features.d.ts +0 -1
- package/dist/types/features.js +0 -1
- package/dist/types/index.d.ts +2 -4
- package/dist/types/index.js +2 -4
- package/dist/types/packageJson.d.ts +24 -0
- package/dist/types/packageJson.js +4 -0
- package/dist/types/viteConfig.d.ts +11 -9
- package/dist/types/viteConfig.js +0 -1
- package/dist/utils/deepMerge.d.ts +3 -1
- package/dist/utils/deepMerge.js +8 -1
- package/dist/utils/ejs.d.ts +3 -2
- package/dist/utils/ejs.js +2 -1
- package/dist/utils/featureMapping.d.ts +44 -0
- package/dist/utils/featureMapping.js +119 -0
- package/dist/utils/file.d.ts +22 -2
- package/dist/utils/file.js +35 -2
- package/dist/utils/generateFrameworkProject.d.ts +27 -0
- package/dist/utils/generateFrameworkProject.js +47 -0
- package/dist/utils/index.d.ts +11 -9
- package/dist/utils/index.js +11 -9
- package/dist/utils/install.d.ts +7 -4
- package/dist/utils/install.js +55 -12
- package/dist/utils/npmConfig.d.ts +15 -0
- package/dist/utils/npmConfig.js +79 -0
- package/dist/utils/prompts.d.ts +3 -2
- package/dist/utils/prompts.js +51 -5
- package/dist/utils/renderFeatures.d.ts +3 -2
- package/dist/utils/renderFeatures.js +41 -37
- package/dist/utils/renderTemplate.d.ts +13 -1
- package/dist/utils/renderTemplate.js +128 -61
- package/dist/utils/sortDependencies.d.ts +3 -2
- package/dist/utils/sortDependencies.js +3 -2
- package/dist/utils/viteConfigRender.d.ts +11 -14
- package/dist/utils/viteConfigRender.js +10 -173
- package/package.json +6 -3
- package/templates/common/base/.env +7 -7
- package/templates/common/base/.env.development +5 -5
- package/templates/common/base/.env.production +5 -5
- package/templates/common/base/package.json +23 -27
- package/templates/common/base/scripts/build.mts +37 -31
- package/templates/common/base/src/apis/index.ts +8 -8
- package/templates/common/base/src/apis/request.ts +43 -43
- package/templates/common/base/src/apis/services/example.ts +61 -40
- package/templates/common/base/src/apis/services/user.ts +33 -23
- package/templates/common/base/src/apis/types/common.ts +43 -28
- package/templates/common/base/src/apis/types/example.ts +15 -3
- package/templates/common/base/src/apis/types/index.ts +7 -7
- package/templates/common/base/src/apis/types/user.ts +39 -24
- package/templates/common/base/src/assets/fonts/index.css +7 -7
- package/templates/common/base/src/assets/styles/base.scss +72 -72
- package/templates/common/base/src/assets/styles/custom.scss +7 -7
- package/templates/common/base/src/assets/styles/tailwind.scss +6 -6
- package/templates/common/base/src/constants/index.ts +29 -29
- package/templates/common/base/src/utils/index.ts +88 -83
- package/templates/{vue/base/vite.config.ts → common/base/vite.config.ts.ejs} +28 -11
- package/templates/common/features/husky/.cz-config.cjs +35 -35
- package/templates/common/features/husky/commitlint.config.ts +32 -32
- package/templates/common/features/husky/node_modules/.bin/commitizen +17 -0
- package/templates/common/features/husky/node_modules/.bin/commitizen.CMD +12 -0
- package/templates/common/features/husky/node_modules/.bin/commitizen.ps1 +41 -0
- package/templates/common/features/husky/node_modules/.bin/commitlint +17 -0
- package/templates/common/features/husky/node_modules/.bin/commitlint.CMD +12 -0
- package/templates/common/features/husky/node_modules/.bin/commitlint.ps1 +41 -0
- package/templates/common/features/husky/node_modules/.bin/cz +17 -0
- package/templates/common/features/husky/node_modules/.bin/cz-cust +17 -0
- package/templates/common/features/husky/node_modules/.bin/cz-cust.CMD +12 -0
- package/templates/common/features/husky/node_modules/.bin/cz-cust.ps1 +41 -0
- package/templates/common/features/husky/node_modules/.bin/cz-customizable +17 -0
- package/templates/common/features/husky/node_modules/.bin/cz-customizable.CMD +12 -0
- package/templates/common/features/husky/node_modules/.bin/cz-customizable.ps1 +41 -0
- package/templates/common/features/husky/node_modules/.bin/cz.CMD +12 -0
- package/templates/common/features/husky/node_modules/.bin/cz.ps1 +41 -0
- package/templates/common/features/husky/node_modules/.bin/git-cz +17 -0
- package/templates/common/features/husky/node_modules/.bin/git-cz.CMD +12 -0
- package/templates/common/features/husky/node_modules/.bin/git-cz.ps1 +41 -0
- package/templates/common/features/husky/node_modules/.bin/husky +17 -0
- package/templates/common/features/husky/node_modules/.bin/husky.CMD +12 -0
- package/templates/common/features/husky/node_modules/.bin/husky.ps1 +41 -0
- package/templates/common/features/husky/node_modules/.bin/lint-staged +17 -0
- package/templates/common/features/husky/node_modules/.bin/lint-staged.CMD +12 -0
- package/templates/common/features/husky/node_modules/.bin/lint-staged.ps1 +41 -0
- package/templates/common/features/husky/package.json +6 -6
- package/templates/react/base/env.d.ts +19 -19
- package/templates/react/base/index.html +14 -14
- package/templates/react/base/node_modules/.bin/vite +17 -0
- package/templates/react/base/node_modules/.bin/vite.CMD +12 -0
- package/templates/react/base/node_modules/.bin/vite.ps1 +41 -0
- package/templates/react/base/package.json +18 -15
- package/templates/react/base/src/App.tsx +18 -18
- package/templates/react/base/src/assets/styles/main.scss +8 -8
- package/templates/react/base/src/pages/about/index.tsx +14 -14
- package/templates/react/base/src/pages/home/index.tsx +14 -14
- package/templates/react/base/tsconfig.app.json +17 -17
- package/templates/react/base/tsconfig.base.json +23 -23
- package/templates/react/base/tsconfig.json +12 -12
- package/templates/react/base/tsconfig.node.json +15 -15
- package/templates/react/features/ant-design/package.json +6 -7
- package/templates/react/features/eslint/node_modules/.bin/eslint +17 -0
- package/templates/react/features/eslint/node_modules/.bin/eslint.CMD +12 -0
- package/templates/react/features/eslint/node_modules/.bin/eslint.ps1 +41 -0
- package/templates/react/features/eslint/package.json +3 -3
- package/templates/react/features/i18n/package.json +6 -7
- package/templates/react/features/i18n/src/locales/index.ts +7 -0
- package/templates/{common/base → react/features/i18n}/src/locales/lang/en.ts +30 -30
- package/templates/{common/base → react/features/i18n}/src/locales/lang/es.ts +30 -30
- package/templates/{common/base → react/features/i18n}/src/locales/lang/zh.ts +30 -30
- package/templates/react/features/manualRoutes/src/router/routes.tsx +13 -0
- package/templates/react/features/pageRoutes/package.json +1 -2
- package/templates/react/features/router/package.json +1 -1
- package/templates/react/features/sentry/package.json +6 -7
- package/templates/react/features/sentry/src/utils/sentry.ts +10 -0
- package/templates/react/features/zustand/package.json +1 -1
- package/templates/react/features/zustand/src/stores/user.ts +42 -6
- package/templates/react/features/zustand/src/types/stores.ts +8 -1
- package/templates/vue/base/env.d.ts +27 -27
- package/templates/vue/base/index.html +14 -14
- package/templates/vue/base/node_modules/.bin/vite +17 -0
- package/templates/vue/base/node_modules/.bin/vite.CMD +12 -0
- package/templates/vue/base/node_modules/.bin/vite.ps1 +41 -0
- package/templates/vue/base/node_modules/.bin/vue-tsc +17 -0
- package/templates/vue/base/node_modules/.bin/vue-tsc.CMD +12 -0
- package/templates/vue/base/node_modules/.bin/vue-tsc.ps1 +41 -0
- package/templates/vue/base/package.json +16 -13
- package/templates/vue/base/src/App.vue +13 -13
- package/templates/vue/base/src/assets/styles/main.scss +9 -9
- package/templates/vue/base/src/directives/index.ts +36 -36
- package/templates/vue/base/src/layouts/index.ts +5 -7
- package/templates/vue/base/src/pages/about/index.vue +31 -31
- package/templates/vue/base/src/pages/home/index.vue +31 -31
- package/templates/vue/base/tsconfig.app.json +17 -17
- package/templates/vue/base/tsconfig.base.json +23 -23
- package/templates/vue/base/tsconfig.json +12 -12
- package/templates/vue/base/tsconfig.node.json +15 -15
- package/templates/vue/features/ant-design-vue/package.json +6 -7
- package/templates/vue/{base → features/ant-design-vue}/src/layouts/AntDesign.vue +86 -86
- package/templates/vue/features/element-plus/package.json +6 -7
- package/templates/vue/{base → features/element-plus}/src/assets/styles/element/index.scss +27 -27
- package/templates/vue/features/element-plus/src/components/SubMenu/index.ts +9 -0
- package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/_types/index.ts +6 -6
- package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/_types/props.ts +11 -11
- package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/index.vue +24 -24
- package/templates/vue/{base → features/element-plus}/src/layouts/element.vue +81 -81
- package/templates/vue/features/eslint/node_modules/.bin/eslint +17 -0
- package/templates/vue/features/eslint/node_modules/.bin/eslint.CMD +12 -0
- package/templates/vue/features/eslint/node_modules/.bin/eslint.ps1 +41 -0
- package/templates/vue/features/eslint/package.json +3 -3
- package/templates/vue/features/i18n/package.json +5 -5
- package/templates/vue/features/i18n/src/locales/index.ts +23 -16
- package/templates/vue/features/i18n/src/locales/lang/en.ts +30 -0
- package/templates/vue/features/i18n/src/locales/lang/es.ts +30 -0
- package/templates/vue/features/i18n/src/locales/lang/zh.ts +30 -0
- package/templates/vue/features/manualRoutes/src/router/routes.ts +35 -27
- package/templates/vue/features/pageRoutes/package.json +5 -5
- package/templates/vue/features/pinia/package.json +3 -2
- package/templates/vue/features/pinia/src/stores/index.ts +8 -0
- package/templates/vue/features/pinia/src/stores/system.ts +60 -0
- package/templates/vue/features/pinia/src/stores/user.ts +33 -13
- package/templates/vue/features/qiankun/package.json +5 -5
- package/templates/vue/features/qiankun/src/qiankun/index.ts +19 -0
- package/templates/vue/features/router/package.json +1 -1
- package/templates/vue/features/sentry/package.json +6 -6
- package/templates/vue/features/sentry/src/utils/sentry.ts +12 -0
- package/dist/commands/create.d.ts.map +0 -1
- package/dist/commands/create.js.map +0 -1
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/generators/index.d.ts.map +0 -1
- package/dist/generators/index.js.map +0 -1
- package/dist/generators/project.d.ts.map +0 -1
- package/dist/generators/project.js.map +0 -1
- package/dist/generators/react.d.ts.map +0 -1
- package/dist/generators/react.js.map +0 -1
- package/dist/generators/vue.d.ts.map +0 -1
- package/dist/generators/vue.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/test.d.ts.map +0 -1
- package/dist/test.js.map +0 -1
- package/dist/types/ejs.d.ts.map +0 -1
- package/dist/types/ejs.js.map +0 -1
- package/dist/types/features.d.ts.map +0 -1
- package/dist/types/features.js.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/viteConfig.d.ts.map +0 -1
- package/dist/types/viteConfig.js.map +0 -1
- package/dist/utils/deepMerge.d.ts.map +0 -1
- package/dist/utils/deepMerge.js.map +0 -1
- package/dist/utils/ejs.d.ts.map +0 -1
- package/dist/utils/ejs.js.map +0 -1
- package/dist/utils/file.d.ts.map +0 -1
- package/dist/utils/file.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/install.d.ts.map +0 -1
- package/dist/utils/install.js.map +0 -1
- package/dist/utils/prompts.d.ts.map +0 -1
- package/dist/utils/prompts.js.map +0 -1
- package/dist/utils/renderFeatures.d.ts.map +0 -1
- package/dist/utils/renderFeatures.js.map +0 -1
- package/dist/utils/renderTemplate.d.ts.map +0 -1
- package/dist/utils/renderTemplate.js.map +0 -1
- package/dist/utils/sortDependencies.d.ts.map +0 -1
- package/dist/utils/sortDependencies.js.map +0 -1
- package/dist/utils/viteConfigRender.d.ts.map +0 -1
- package/dist/utils/viteConfigRender.js.map +0 -1
- package/templates/common/base/pnpm-workspace.yaml +0 -37
- package/templates/common/features/husky/pnpm-workspace.yaml +0 -9
- package/templates/react/base/pnpm-workspace.yaml +0 -9
- package/templates/react/base/src/stores/user.ts +0 -39
- package/templates/react/base/vite.config.ts +0 -52
- package/templates/react/features/ant-design/pnpm-workspace.yaml +0 -5
- package/templates/react/features/eslint/pnpm-workspace.yaml +0 -6
- package/templates/react/features/i18n/pnpm-workspace.yaml +0 -5
- package/templates/react/features/pageRoutes/pnpm-workspace.yaml +0 -4
- package/templates/react/features/pageRoutes/vite.config.data.ts +0 -10
- package/templates/react/features/router/pnpm-workspace.yaml +0 -3
- package/templates/react/features/sentry/pnpm-workspace.yaml +0 -5
- package/templates/react/features/sentry/vite.config.data.ts +0 -23
- package/templates/react/features/zustand/pnpm-workspace.yaml +0 -3
- package/templates/vue/base/pnpm-workspace.yaml +0 -6
- package/templates/vue/base/src/components/SubMenu/index.ts +0 -9
- package/templates/vue/base/src/stores/index.ts +0 -16
- package/templates/vue/base/src/stores/modules/system.ts +0 -52
- package/templates/vue/base/src/stores/modules/user.ts +0 -48
- package/templates/vue/features/ant-design-vue/pnpm-workspace.yaml +0 -5
- package/templates/vue/features/element-plus/pnpm-workspace.yaml +0 -5
- package/templates/vue/features/element-plus/vite.config.data.ts +0 -15
- package/templates/vue/features/eslint/pnpm-workspace.yaml +0 -6
- package/templates/vue/features/i18n/pnpm-workspace.yaml +0 -3
- package/templates/vue/features/pageRoutes/pnpm-workspace.yaml +0 -4
- package/templates/vue/features/pageRoutes/vite.config.data.ts +0 -9
- package/templates/vue/features/pinia/pnpm-workspace.yaml +0 -4
- package/templates/vue/features/qiankun/pnpm-workspace.yaml +0 -3
- package/templates/vue/features/router/pnpm-workspace.yaml +0 -3
- package/templates/vue/features/sentry/pnpm-workspace.yaml +0 -4
- package/templates/vue/features/sentry/vite.config.data.ts +0 -23
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"moduleResolution": "bundler",
|
|
9
|
-
"allowImportingTsExtensions": true,
|
|
10
|
-
"isolatedModules": true,
|
|
11
|
-
"moduleDetection": "force",
|
|
12
|
-
"noEmit": true,
|
|
13
|
-
"jsx": "preserve",
|
|
14
|
-
"strict": true,
|
|
15
|
-
"noUnusedLocals": true,
|
|
16
|
-
"noUnusedParameters": true,
|
|
17
|
-
"noFallthroughCasesInSwitch": true,
|
|
18
|
-
"noUncheckedSideEffectImports": true,
|
|
19
|
-
"resolveJsonModule": true,
|
|
20
|
-
"esModuleInterop": true
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"moduleDetection": "force",
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"jsx": "preserve",
|
|
14
|
+
"strict": true,
|
|
15
|
+
"noUnusedLocals": true,
|
|
16
|
+
"noUnusedParameters": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
|
+
"noUncheckedSideEffectImports": true,
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"esModuleInterop": true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files": [],
|
|
3
|
-
"references": [
|
|
4
|
-
{
|
|
5
|
-
"path": "./tsconfig.app.json"
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"path": "./tsconfig.node.json"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
|
12
|
-
|
|
1
|
+
{
|
|
2
|
+
"files": [],
|
|
3
|
+
"references": [
|
|
4
|
+
{
|
|
5
|
+
"path": "./tsconfig.app.json"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"path": "./tsconfig.node.json"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"composite": true,
|
|
5
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
6
|
-
"types": ["node"]
|
|
7
|
-
},
|
|
8
|
-
"include": [
|
|
9
|
-
"vite.config.*",
|
|
10
|
-
"eslint.config.*",
|
|
11
|
-
"commitlint.config.*",
|
|
12
|
-
"scripts/**/*"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"composite": true,
|
|
5
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
6
|
+
"types": ["node"]
|
|
7
|
+
},
|
|
8
|
+
"include": [
|
|
9
|
+
"vite.config.*",
|
|
10
|
+
"eslint.config.*",
|
|
11
|
+
"commitlint.config.*",
|
|
12
|
+
"scripts/**/*"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"dependencies": {
|
|
3
|
-
"@ant-design/icons-vue": "
|
|
4
|
-
"ant-design-vue": "
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
1
|
+
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"@ant-design/icons-vue": "^7.0.1",
|
|
4
|
+
"ant-design-vue": "^4.2.1"
|
|
5
|
+
}
|
|
6
|
+
}
|
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Ant Design Vue 布局组件
|
|
4
|
-
*/
|
|
5
|
-
import { ref } from 'vue';
|
|
6
|
-
|
|
7
|
-
const sidebarCollapsed = ref(false);
|
|
8
|
-
|
|
9
|
-
function toggleSidebar(): void {
|
|
10
|
-
sidebarCollapsed.value = !sidebarCollapsed.value;
|
|
11
|
-
}
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<a-layout class="layout-container">
|
|
16
|
-
<a-layout-sider
|
|
17
|
-
v-model:collapsed="sidebarCollapsed"
|
|
18
|
-
collapsible
|
|
19
|
-
:trigger="null"
|
|
20
|
-
class="layout-sider"
|
|
21
|
-
>
|
|
22
|
-
<div class="logo">
|
|
23
|
-
<span v-if="!sidebarCollapsed">Logo</span>
|
|
24
|
-
</div>
|
|
25
|
-
<a-menu theme="dark" mode="inline" :default-selected-keys="['1']">
|
|
26
|
-
<a-menu-item key="1">
|
|
27
|
-
<span>首页</span>
|
|
28
|
-
</a-menu-item>
|
|
29
|
-
<a-menu-item key="2">
|
|
30
|
-
<span>关于</span>
|
|
31
|
-
</a-menu-item>
|
|
32
|
-
</a-menu>
|
|
33
|
-
</a-layout-sider>
|
|
34
|
-
<a-layout>
|
|
35
|
-
<a-layout-header class="layout-header">
|
|
36
|
-
<a-button @click="toggleSidebar">
|
|
37
|
-
{{ sidebarCollapsed ? '展开' : '折叠' }}
|
|
38
|
-
</a-button>
|
|
39
|
-
</a-layout-header>
|
|
40
|
-
<a-layout-content class="layout-content">
|
|
41
|
-
<slot />
|
|
42
|
-
</a-layout-content>
|
|
43
|
-
</a-layout>
|
|
44
|
-
</a-layout>
|
|
45
|
-
</template>
|
|
46
|
-
|
|
47
|
-
<style scoped lang="scss">
|
|
48
|
-
.layout-container {
|
|
49
|
-
height: 100vh;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.layout-sider {
|
|
53
|
-
overflow: auto;
|
|
54
|
-
height: 100vh;
|
|
55
|
-
position: fixed;
|
|
56
|
-
left: 0;
|
|
57
|
-
top: 0;
|
|
58
|
-
bottom: 0;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.logo {
|
|
62
|
-
height: 32px;
|
|
63
|
-
margin: 16px;
|
|
64
|
-
display: flex;
|
|
65
|
-
align-items: center;
|
|
66
|
-
justify-content: center;
|
|
67
|
-
color: #fff;
|
|
68
|
-
font-size: 18px;
|
|
69
|
-
font-weight: bold;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.layout-header {
|
|
73
|
-
background: #fff;
|
|
74
|
-
padding: 0 16px;
|
|
75
|
-
display: flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.layout-content {
|
|
80
|
-
margin: 24px 16px;
|
|
81
|
-
padding: 24px;
|
|
82
|
-
background: #fff;
|
|
83
|
-
min-height: 280px;
|
|
84
|
-
}
|
|
85
|
-
</style>
|
|
86
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Ant Design Vue 布局组件
|
|
4
|
+
*/
|
|
5
|
+
import { ref } from 'vue';
|
|
6
|
+
|
|
7
|
+
const sidebarCollapsed = ref(false);
|
|
8
|
+
|
|
9
|
+
function toggleSidebar(): void {
|
|
10
|
+
sidebarCollapsed.value = !sidebarCollapsed.value;
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<a-layout class="layout-container">
|
|
16
|
+
<a-layout-sider
|
|
17
|
+
v-model:collapsed="sidebarCollapsed"
|
|
18
|
+
collapsible
|
|
19
|
+
:trigger="null"
|
|
20
|
+
class="layout-sider"
|
|
21
|
+
>
|
|
22
|
+
<div class="logo">
|
|
23
|
+
<span v-if="!sidebarCollapsed">Logo</span>
|
|
24
|
+
</div>
|
|
25
|
+
<a-menu theme="dark" mode="inline" :default-selected-keys="['1']">
|
|
26
|
+
<a-menu-item key="1">
|
|
27
|
+
<span>首页</span>
|
|
28
|
+
</a-menu-item>
|
|
29
|
+
<a-menu-item key="2">
|
|
30
|
+
<span>关于</span>
|
|
31
|
+
</a-menu-item>
|
|
32
|
+
</a-menu>
|
|
33
|
+
</a-layout-sider>
|
|
34
|
+
<a-layout>
|
|
35
|
+
<a-layout-header class="layout-header">
|
|
36
|
+
<a-button @click="toggleSidebar">
|
|
37
|
+
{{ sidebarCollapsed ? '展开' : '折叠' }}
|
|
38
|
+
</a-button>
|
|
39
|
+
</a-layout-header>
|
|
40
|
+
<a-layout-content class="layout-content">
|
|
41
|
+
<slot />
|
|
42
|
+
</a-layout-content>
|
|
43
|
+
</a-layout>
|
|
44
|
+
</a-layout>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<style scoped lang="scss">
|
|
48
|
+
.layout-container {
|
|
49
|
+
height: 100vh;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.layout-sider {
|
|
53
|
+
overflow: auto;
|
|
54
|
+
height: 100vh;
|
|
55
|
+
position: fixed;
|
|
56
|
+
left: 0;
|
|
57
|
+
top: 0;
|
|
58
|
+
bottom: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.logo {
|
|
62
|
+
height: 32px;
|
|
63
|
+
margin: 16px;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
color: #fff;
|
|
68
|
+
font-size: 18px;
|
|
69
|
+
font-weight: bold;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.layout-header {
|
|
73
|
+
background: #fff;
|
|
74
|
+
padding: 0 16px;
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.layout-content {
|
|
80
|
+
margin: 24px 16px;
|
|
81
|
+
padding: 24px;
|
|
82
|
+
background: #fff;
|
|
83
|
+
min-height: 280px;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
86
|
+
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"dependencies": {
|
|
3
|
-
"@element-plus/icons-vue": "
|
|
4
|
-
"element-plus": "
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
1
|
+
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"@element-plus/icons-vue": "^2.3.1",
|
|
4
|
+
"element-plus": "^2.11.3"
|
|
5
|
+
}
|
|
6
|
+
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Element Plus 样式定制
|
|
3
|
-
* 自定义 Element Plus 主题
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
@forward 'element-plus/theme-chalk/src/common/var.scss' with (
|
|
7
|
-
$colors: (
|
|
8
|
-
'primary': (
|
|
9
|
-
'base': #409eff,
|
|
10
|
-
),
|
|
11
|
-
'success': (
|
|
12
|
-
'base': #67c23a,
|
|
13
|
-
),
|
|
14
|
-
'warning': (
|
|
15
|
-
'base': #e6a23c,
|
|
16
|
-
),
|
|
17
|
-
'danger': (
|
|
18
|
-
'base': #f56c6c,
|
|
19
|
-
),
|
|
20
|
-
'info': (
|
|
21
|
-
'base': #909399,
|
|
22
|
-
),
|
|
23
|
-
),
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
@use 'element-plus/theme-chalk/src/index.scss' as *;
|
|
27
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Element Plus 样式定制
|
|
3
|
+
* 自定义 Element Plus 主题
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@forward 'element-plus/theme-chalk/src/common/var.scss' with (
|
|
7
|
+
$colors: (
|
|
8
|
+
'primary': (
|
|
9
|
+
'base': #409eff,
|
|
10
|
+
),
|
|
11
|
+
'success': (
|
|
12
|
+
'base': #67c23a,
|
|
13
|
+
),
|
|
14
|
+
'warning': (
|
|
15
|
+
'base': #e6a23c,
|
|
16
|
+
),
|
|
17
|
+
'danger': (
|
|
18
|
+
'base': #f56c6c,
|
|
19
|
+
),
|
|
20
|
+
'info': (
|
|
21
|
+
'base': #909399,
|
|
22
|
+
),
|
|
23
|
+
),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
@use 'element-plus/theme-chalk/src/index.scss' as *;
|
|
27
|
+
|
package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/_types/index.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SubMenu 类型导出
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export * from './props'
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* SubMenu 类型导出
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export * from './props'
|
|
6
|
+
|
package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/_types/props.ts
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SubMenu Props 类型定义
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { RouteRecordRaw } from 'vue-router'
|
|
6
|
-
|
|
7
|
-
export interface SubMenuProps {
|
|
8
|
-
/** 菜单列表 */
|
|
9
|
-
menuList: RouteRecordRaw[]
|
|
10
|
-
}
|
|
11
|
-
|
|
1
|
+
/**
|
|
2
|
+
* SubMenu Props 类型定义
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { RouteRecordRaw } from 'vue-router'
|
|
6
|
+
|
|
7
|
+
export interface SubMenuProps {
|
|
8
|
+
/** 菜单列表 */
|
|
9
|
+
menuList: RouteRecordRaw[]
|
|
10
|
+
}
|
|
11
|
+
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* SubMenu 子菜单组件
|
|
4
|
-
* 递归渲染菜单
|
|
5
|
-
*/
|
|
6
|
-
import type { SubMenuProps } from './_types'
|
|
7
|
-
|
|
8
|
-
defineProps<SubMenuProps>()
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<template>
|
|
12
|
-
<template v-for="item in menuList" :key="item.path">
|
|
13
|
-
<el-sub-menu v-if="item.children?.length" :index="item.path">
|
|
14
|
-
<template #title>
|
|
15
|
-
<span>{{ item.meta?.title }}</span>
|
|
16
|
-
</template>
|
|
17
|
-
<SubMenu :menu-list="item.children" />
|
|
18
|
-
</el-sub-menu>
|
|
19
|
-
<el-menu-item v-else :index="item.path">
|
|
20
|
-
<span>{{ item.meta?.title }}</span>
|
|
21
|
-
</el-menu-item>
|
|
22
|
-
</template>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* SubMenu 子菜单组件
|
|
4
|
+
* 递归渲染菜单
|
|
5
|
+
*/
|
|
6
|
+
import type { SubMenuProps } from './_types'
|
|
7
|
+
|
|
8
|
+
defineProps<SubMenuProps>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<template v-for="item in menuList" :key="item.path">
|
|
13
|
+
<el-sub-menu v-if="item.children?.length" :index="item.path">
|
|
14
|
+
<template #title>
|
|
15
|
+
<span>{{ item.meta?.title }}</span>
|
|
16
|
+
</template>
|
|
17
|
+
<SubMenu :menu-list="item.children" />
|
|
18
|
+
</el-sub-menu>
|
|
19
|
+
<el-menu-item v-else :index="item.path">
|
|
20
|
+
<span>{{ item.meta?.title }}</span>
|
|
21
|
+
</el-menu-item>
|
|
22
|
+
</template>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Element Plus 布局组件
|
|
4
|
-
*/
|
|
5
|
-
import { ref } from 'vue';
|
|
6
|
-
|
|
7
|
-
const sidebarCollapsed = ref(false);
|
|
8
|
-
|
|
9
|
-
function toggleSidebar(): void {
|
|
10
|
-
sidebarCollapsed.value = !sidebarCollapsed.value;
|
|
11
|
-
}
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<el-container class="layout-container">
|
|
16
|
-
<el-aside :width="sidebarCollapsed ? '64px' : '200px'" class="layout-aside">
|
|
17
|
-
<div class="logo">
|
|
18
|
-
<span v-if="!sidebarCollapsed">Logo</span>
|
|
19
|
-
</div>
|
|
20
|
-
<el-menu
|
|
21
|
-
:collapse="sidebarCollapsed"
|
|
22
|
-
default-active="1"
|
|
23
|
-
class="layout-menu"
|
|
24
|
-
>
|
|
25
|
-
<el-menu-item index="1">
|
|
26
|
-
<template #title>首页</template>
|
|
27
|
-
</el-menu-item>
|
|
28
|
-
<el-menu-item index="2">
|
|
29
|
-
<template #title>关于</template>
|
|
30
|
-
</el-menu-item>
|
|
31
|
-
</el-menu>
|
|
32
|
-
</el-aside>
|
|
33
|
-
<el-container>
|
|
34
|
-
<el-header class="layout-header">
|
|
35
|
-
<el-button @click="toggleSidebar">
|
|
36
|
-
{{ sidebarCollapsed ? '展开' : '折叠' }}
|
|
37
|
-
</el-button>
|
|
38
|
-
</el-header>
|
|
39
|
-
<el-main class="layout-main">
|
|
40
|
-
<slot />
|
|
41
|
-
</el-main>
|
|
42
|
-
</el-container>
|
|
43
|
-
</el-container>
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<style scoped lang="scss">
|
|
47
|
-
.layout-container {
|
|
48
|
-
height: 100vh;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.layout-aside {
|
|
52
|
-
background-color: #304156;
|
|
53
|
-
transition: width 0.3s;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.logo {
|
|
57
|
-
height: 60px;
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
justify-content: center;
|
|
61
|
-
color: #fff;
|
|
62
|
-
font-size: 20px;
|
|
63
|
-
font-weight: bold;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.layout-menu {
|
|
67
|
-
border-right: none;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.layout-header {
|
|
71
|
-
background-color: #fff;
|
|
72
|
-
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.layout-main {
|
|
78
|
-
background-color: #f0f2f5;
|
|
79
|
-
}
|
|
80
|
-
</style>
|
|
81
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Element Plus 布局组件
|
|
4
|
+
*/
|
|
5
|
+
import { ref } from 'vue';
|
|
6
|
+
|
|
7
|
+
const sidebarCollapsed = ref(false);
|
|
8
|
+
|
|
9
|
+
function toggleSidebar(): void {
|
|
10
|
+
sidebarCollapsed.value = !sidebarCollapsed.value;
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<el-container class="layout-container">
|
|
16
|
+
<el-aside :width="sidebarCollapsed ? '64px' : '200px'" class="layout-aside">
|
|
17
|
+
<div class="logo">
|
|
18
|
+
<span v-if="!sidebarCollapsed">Logo</span>
|
|
19
|
+
</div>
|
|
20
|
+
<el-menu
|
|
21
|
+
:collapse="sidebarCollapsed"
|
|
22
|
+
default-active="1"
|
|
23
|
+
class="layout-menu"
|
|
24
|
+
>
|
|
25
|
+
<el-menu-item index="1">
|
|
26
|
+
<template #title>首页</template>
|
|
27
|
+
</el-menu-item>
|
|
28
|
+
<el-menu-item index="2">
|
|
29
|
+
<template #title>关于</template>
|
|
30
|
+
</el-menu-item>
|
|
31
|
+
</el-menu>
|
|
32
|
+
</el-aside>
|
|
33
|
+
<el-container>
|
|
34
|
+
<el-header class="layout-header">
|
|
35
|
+
<el-button @click="toggleSidebar">
|
|
36
|
+
{{ sidebarCollapsed ? '展开' : '折叠' }}
|
|
37
|
+
</el-button>
|
|
38
|
+
</el-header>
|
|
39
|
+
<el-main class="layout-main">
|
|
40
|
+
<slot />
|
|
41
|
+
</el-main>
|
|
42
|
+
</el-container>
|
|
43
|
+
</el-container>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<style scoped lang="scss">
|
|
47
|
+
.layout-container {
|
|
48
|
+
height: 100vh;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.layout-aside {
|
|
52
|
+
background-color: #304156;
|
|
53
|
+
transition: width 0.3s;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.logo {
|
|
57
|
+
height: 60px;
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
color: #fff;
|
|
62
|
+
font-size: 20px;
|
|
63
|
+
font-weight: bold;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.layout-menu {
|
|
67
|
+
border-right: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.layout-header {
|
|
71
|
+
background-color: #fff;
|
|
72
|
+
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.layout-main {
|
|
78
|
+
background-color: #f0f2f5;
|
|
79
|
+
}
|
|
80
|
+
</style>
|
|
81
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/eslint@9.39.2_jiti@2.6.1/node_modules/eslint/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/eslint@9.39.2_jiti@2.6.1/node_modules/eslint/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/eslint@9.39.2_jiti@2.6.1/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/eslint@9.39.2_jiti@2.6.1/node_modules/eslint/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/eslint@9.39.2_jiti@2.6.1/node_modules/eslint/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/eslint@9.39.2_jiti@2.6.1/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../eslint/bin/eslint.js" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../eslint/bin/eslint.js" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@SETLOCAL
|
|
2
|
+
@IF NOT DEFINED NODE_PATH (
|
|
3
|
+
@SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\eslint@9.39.2_jiti@2.6.1\node_modules\eslint\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\eslint@9.39.2_jiti@2.6.1\node_modules\eslint\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\eslint@9.39.2_jiti@2.6.1\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
|
|
4
|
+
) ELSE (
|
|
5
|
+
@SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\eslint@9.39.2_jiti@2.6.1\node_modules\eslint\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\eslint@9.39.2_jiti@2.6.1\node_modules\eslint\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\eslint@9.39.2_jiti@2.6.1\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules;%NODE_PATH%"
|
|
6
|
+
)
|
|
7
|
+
@IF EXIST "%~dp0\node.exe" (
|
|
8
|
+
"%~dp0\node.exe" "%~dp0\..\eslint\bin\eslint.js" %*
|
|
9
|
+
) ELSE (
|
|
10
|
+
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
11
|
+
node "%~dp0\..\eslint\bin\eslint.js" %*
|
|
12
|
+
)
|