@moluoxixi/create-app 2.0.413 → 2.0.414

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 (187) hide show
  1. package/README.md +57 -1
  2. package/dist/commands/create.js +1 -1
  3. package/dist/core/feature.d.ts +80 -0
  4. package/dist/core/feature.js +252 -0
  5. package/dist/core/index.d.ts +6 -0
  6. package/dist/core/index.js +6 -0
  7. package/dist/core/prompts.d.ts +17 -0
  8. package/dist/core/prompts.js +235 -0
  9. package/dist/core/template.d.ts +22 -0
  10. package/dist/core/template.js +177 -0
  11. package/dist/generators/index.d.ts +0 -2
  12. package/dist/generators/index.js +0 -2
  13. package/dist/generators/project.d.ts +1 -0
  14. package/dist/generators/project.js +66 -13
  15. package/dist/generators/react.d.ts +5 -5
  16. package/dist/generators/react.js +6 -9
  17. package/dist/generators/vue.d.ts +5 -5
  18. package/dist/generators/vue.js +6 -9
  19. package/dist/test.d.ts +0 -4
  20. package/dist/test.js +32 -17
  21. package/dist/types/index.d.ts +25 -26
  22. package/dist/types/index.js +2 -3
  23. package/dist/utils/featureMapping.js +6 -3
  24. package/dist/utils/generateFrameworkProject.d.ts +10 -20
  25. package/dist/utils/generateFrameworkProject.js +32 -127
  26. package/dist/utils/index.d.ts +1 -6
  27. package/dist/utils/index.js +1 -6
  28. package/dist/utils/prompts.js +7 -3
  29. package/package.json +2 -2
  30. package/templates/common/base/package.json +3 -1
  31. package/templates/common/base/vite/index.ts +53 -0
  32. package/templates/common/base/vite.config.ts +56 -0
  33. package/templates/common/features/husky/node_modules/.bin/tsc +17 -0
  34. package/templates/common/features/husky/node_modules/.bin/tsc.CMD +12 -0
  35. package/templates/common/features/husky/node_modules/.bin/tsc.ps1 +41 -0
  36. package/templates/common/features/husky/node_modules/.bin/tsserver +17 -0
  37. package/templates/common/features/husky/node_modules/.bin/tsserver.CMD +12 -0
  38. package/templates/common/features/husky/node_modules/.bin/tsserver.ps1 +41 -0
  39. package/templates/react/base/src/main/index.ts +34 -0
  40. package/templates/react/base/src/main.tsx +34 -0
  41. package/templates/react/base/tsconfig.app.json +1 -0
  42. package/templates/react/base/tsconfig.node.json +1 -0
  43. package/templates/react/features/ant-design/package.json +2 -1
  44. package/templates/react/features/ant-design/src/main/features/ant-design.ts +21 -0
  45. package/templates/react/features/i18n/package.json +2 -1
  46. package/templates/react/features/i18n/src/main/features/i18n.ts +19 -0
  47. package/templates/react/features/manualRoutes/package.json +1 -0
  48. package/templates/react/features/sentry/package.json +2 -1
  49. package/templates/react/features/sentry/src/main/features/sentry.ts +20 -0
  50. package/templates/react/features/sentry/vite/features/sentry.ts +39 -0
  51. package/templates/react/features/zustand/src/apis/types/user.ts +39 -0
  52. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/jiti +17 -0
  53. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/jiti.CMD +12 -0
  54. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/jiti.ps1 +41 -0
  55. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/parser +17 -0
  56. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/parser.CMD +12 -0
  57. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/parser.ps1 +41 -0
  58. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/rollup +17 -0
  59. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/rollup.CMD +12 -0
  60. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/rollup.ps1 +41 -0
  61. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/sass +17 -0
  62. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/sass.CMD +12 -0
  63. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/sass.ps1 +41 -0
  64. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/terser +17 -0
  65. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/terser.CMD +12 -0
  66. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/terser.ps1 +41 -0
  67. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/tsc +17 -0
  68. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/tsc.CMD +12 -0
  69. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/tsc.ps1 +41 -0
  70. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/tsserver +17 -0
  71. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/tsserver.CMD +12 -0
  72. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/tsserver.ps1 +41 -0
  73. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/tsx +17 -0
  74. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/tsx.CMD +12 -0
  75. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/tsx.ps1 +41 -0
  76. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/vite +17 -0
  77. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/vite.CMD +12 -0
  78. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/vite.ps1 +41 -0
  79. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/yaml +17 -0
  80. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/yaml.CMD +12 -0
  81. package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/yaml.ps1 +41 -0
  82. package/templates/react/micro-frontends/qiankun/base/package.json +7 -2
  83. package/templates/react/micro-frontends/qiankun/base/src/main/index.ts +34 -0
  84. package/templates/react/micro-frontends/qiankun/base/src/{main.tsx.ejs → main.tsx} +13 -27
  85. package/templates/react/micro-frontends/qiankun/base/vite/index.ts +53 -0
  86. package/templates/react/micro-frontends/qiankun/base/vite.config.ts +58 -0
  87. package/templates/vue/base/src/main/index.ts +36 -0
  88. package/templates/vue/base/src/main.ts +34 -0
  89. package/templates/vue/base/tsconfig.app.json +2 -1
  90. package/templates/vue/base/tsconfig.node.json +2 -1
  91. package/templates/vue/features/ant-design-vue/package.json +3 -1
  92. package/templates/vue/features/ant-design-vue/src/main/features/ant-design-vue.ts +18 -0
  93. package/templates/vue/features/element-plus/package.json +5 -1
  94. package/templates/vue/features/element-plus/src/main/features/element-plus.ts +23 -0
  95. package/templates/vue/features/element-plus/src/stores/index.ts +6 -0
  96. package/templates/vue/features/element-plus/src/stores/modules/system.ts +51 -0
  97. package/templates/vue/features/element-plus/vite/features/element-plus.ts +35 -0
  98. package/templates/vue/features/i18n/package.json +3 -1
  99. package/templates/vue/features/i18n/src/main/features/i18n.ts +19 -0
  100. package/templates/vue/features/manualRoutes/package.json +7 -1
  101. package/templates/vue/features/manualRoutes/src/layouts/index.ts +26 -0
  102. package/templates/vue/features/manualRoutes/src/stores/index.ts +6 -0
  103. package/templates/vue/features/manualRoutes/src/stores/modules/system.ts +51 -0
  104. package/templates/vue/features/pageRoutes/package.json +7 -1
  105. package/templates/vue/features/pageRoutes/src/layouts/index.ts +26 -0
  106. package/templates/vue/features/pageRoutes/src/stores/index.ts +6 -0
  107. package/templates/vue/features/pageRoutes/src/stores/modules/system.ts +51 -0
  108. package/templates/vue/features/pinia/package.json +3 -1
  109. package/templates/vue/features/pinia/src/main/features/pinia.ts +19 -0
  110. package/templates/vue/features/sentry/package.json +4 -2
  111. package/templates/vue/features/sentry/src/main/features/sentry.ts +22 -0
  112. package/templates/vue/features/sentry/vite/features/sentry.ts +39 -0
  113. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/jiti +17 -0
  114. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/jiti.CMD +12 -0
  115. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/jiti.ps1 +41 -0
  116. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/parser +17 -0
  117. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/parser.CMD +12 -0
  118. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/parser.ps1 +41 -0
  119. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/rollup +17 -0
  120. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/rollup.CMD +12 -0
  121. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/rollup.ps1 +41 -0
  122. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/sass +17 -0
  123. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/sass.CMD +12 -0
  124. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/sass.ps1 +41 -0
  125. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/terser +17 -0
  126. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/terser.CMD +12 -0
  127. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/terser.ps1 +41 -0
  128. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/tsc +17 -0
  129. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/tsc.CMD +12 -0
  130. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/tsc.ps1 +41 -0
  131. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/tsserver +17 -0
  132. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/tsserver.CMD +12 -0
  133. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/tsserver.ps1 +41 -0
  134. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/tsx +17 -0
  135. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/tsx.CMD +12 -0
  136. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/tsx.ps1 +41 -0
  137. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/vite +17 -0
  138. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/vite.CMD +12 -0
  139. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/vite.ps1 +41 -0
  140. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/yaml +17 -0
  141. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/yaml.CMD +12 -0
  142. package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/yaml.ps1 +41 -0
  143. package/templates/vue/micro-frontends/qiankun/base/package.json +7 -2
  144. package/templates/vue/micro-frontends/qiankun/base/src/main/index.ts +36 -0
  145. package/templates/vue/micro-frontends/qiankun/base/src/{main.ts.ejs → main.ts} +11 -28
  146. package/templates/vue/micro-frontends/qiankun/base/vite/index.ts +53 -0
  147. package/templates/vue/micro-frontends/qiankun/base/vite.config.ts +59 -0
  148. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/jiti +17 -0
  149. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/jiti.CMD +12 -0
  150. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/jiti.ps1 +41 -0
  151. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/sass +17 -0
  152. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/sass.CMD +12 -0
  153. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/sass.ps1 +41 -0
  154. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/terser +17 -0
  155. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/terser.CMD +12 -0
  156. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/terser.ps1 +41 -0
  157. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/tsc +17 -0
  158. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/tsc.CMD +12 -0
  159. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/tsc.ps1 +41 -0
  160. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/tsserver +17 -0
  161. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/tsserver.CMD +12 -0
  162. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/tsserver.ps1 +41 -0
  163. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/tsx +17 -0
  164. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/tsx.CMD +12 -0
  165. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/tsx.ps1 +41 -0
  166. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/vite +17 -0
  167. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/vite.CMD +12 -0
  168. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/vite.ps1 +41 -0
  169. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/yaml +17 -0
  170. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/yaml.CMD +12 -0
  171. package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/yaml.ps1 +41 -0
  172. package/templates/vue/micro-frontends/qiankun/features/element-plus/package.json +10 -0
  173. package/templates/vue/micro-frontends/qiankun/features/element-plus/src/components/SubMenu/index.ts +8 -0
  174. package/templates/vue/micro-frontends/qiankun/features/element-plus/src/components/SubMenu/src/_types/index.ts +1 -0
  175. package/templates/vue/micro-frontends/qiankun/features/element-plus/src/components/SubMenu/src/_types/props.ts +16 -0
  176. package/templates/vue/micro-frontends/qiankun/features/element-plus/src/components/SubMenu/src/index.vue +60 -0
  177. package/templates/vue/micro-frontends/qiankun/features/element-plus/src/main/features/element-plus.ts +24 -0
  178. package/templates/vue/micro-frontends/qiankun/features/element-plus/src/stores/index.ts +6 -0
  179. package/templates/vue/micro-frontends/qiankun/features/element-plus/src/stores/modules/system.ts +51 -0
  180. package/templates/vue/micro-frontends/qiankun/features/element-plus/vite/features/element-plus.ts +35 -0
  181. package/templates/vue/micro-frontends/qiankun/features/manualRoutes/package.json +6 -1
  182. package/templates/vue/micro-frontends/qiankun/features/pageRoutes/package.json +6 -1
  183. package/templates/common/base/vite.config.ts.ejs +0 -85
  184. package/templates/react/base/src/main.tsx.ejs +0 -56
  185. package/templates/react/micro-frontends/qiankun/base/vite.config.ts.ejs +0 -89
  186. package/templates/vue/base/src/main.ts.ejs +0 -61
  187. package/templates/vue/micro-frontends/qiankun/base/vite.config.ts.ejs +0 -89
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsc" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsc" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsc" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsc" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -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/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/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/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/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/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" "$@"
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\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\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\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\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\..\..\..\..\..\..\..\..\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\tsserver" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\..\..\..\..\..\..\..\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\tsserver" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules\typescript\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/tsserver" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -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/tsx@4.21.0/node_modules/tsx/dist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/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/tsx@4.21.0/node_modules/tsx/dist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/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/../../../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" "$@"
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\tsx@4.21.0\node_modules\tsx\dist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\node_modules\tsx\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\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\tsx@4.21.0\node_modules\tsx\dist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\node_modules\tsx\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\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\..\..\..\..\..\..\..\..\node_modules\.pnpm\tsx@4.21.0\node_modules\tsx\dist\cli.mjs" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\..\..\..\..\..\..\..\node_modules\.pnpm\tsx@4.21.0\node_modules\tsx\dist\cli.mjs" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\node_modules\tsx\dist\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\node_modules\tsx\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\tsx@4.21.0\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/tsx@4.21.0/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -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/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/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/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/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/../../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.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\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\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\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\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\..\..\..\..\..\..\..\..\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\bin\vite.js" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\..\..\..\..\..\..\..\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\bin\vite.js" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules\vite\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/vite@7.3.0_@types+node@22.1_7c06d9c6f7b7316383c1af6ed786169b/node_modules/vite/bin/vite.js" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -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/yaml@2.8.2/node_modules/yaml/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/yaml@2.8.2/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/yaml@2.8.2/node_modules/yaml/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/yaml@2.8.2/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/../../../../../../../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/bin.mjs" "$@"
15
+ else
16
+ exec node "$basedir/../../../../../../../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/bin.mjs" "$@"
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\yaml@2.8.2\node_modules\yaml\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\yaml@2.8.2\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\yaml@2.8.2\node_modules\yaml\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\yaml@2.8.2\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\..\..\..\..\..\..\..\..\node_modules\.pnpm\yaml@2.8.2\node_modules\yaml\bin.mjs" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\..\..\..\..\..\..\..\node_modules\.pnpm\yaml@2.8.2\node_modules\yaml\bin.mjs" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\yaml@2.8.2\node_modules\yaml\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\yaml@2.8.2\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/yaml@2.8.2/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/bin.mjs" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/bin.mjs" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/bin.mjs" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../../../../../../../../node_modules/.pnpm/yaml@2.8.2/node_modules/yaml/bin.mjs" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -0,0 +1,10 @@
1
+ {
2
+ "dependencies": {
3
+ "element-plus": "^2.11.3",
4
+ "pinia": "^2.2.7",
5
+ "pinia-plugin-persistedstate": "^3.2.1",
6
+ "vite-plugin-qiankun": "^1.0.15",
7
+ "vue": "^3.5.13",
8
+ "vue-router": "^4.4.5"
9
+ }
10
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * SubMenu 组件导出
3
+ */
4
+
5
+ import SubMenu from './src/index.vue'
6
+
7
+ export { SubMenu }
8
+ export default SubMenu
@@ -0,0 +1,16 @@
1
+ export interface subMenuRouteMetaType {
2
+ title?: string
3
+ [key: string]: unknown
4
+ }
5
+
6
+ export interface subMenuRouteType {
7
+ path?: string
8
+ name?: string
9
+ meta?: subMenuRouteMetaType
10
+ children?: subMenuRouteType[]
11
+ }
12
+
13
+ export interface propsType {
14
+ routes: subMenuRouteType[]
15
+ menuHeight?: number
16
+ }
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <template
3
+ v-for="(route, index) in props.routes"
4
+ :key="getRouteKey(route, index)"
5
+ >
6
+ <ElSubMenu
7
+ v-if="hasChildren(route)"
8
+ :teleported="false"
9
+ :index="getRouteIndex(route, index)"
10
+ >
11
+ <template #title>
12
+ {{ getRouteTitle(route) }}
13
+ </template>
14
+ <div :style="`max-height: calc(100vh - ${props.menuHeight || 0}px - 30px);overflow: auto`">
15
+ <SubMenu :routes="route.children ?? []" />
16
+ </div>
17
+ </ElSubMenu>
18
+
19
+ <ElMenuItem
20
+ v-else
21
+ :index="getRouteIndex(route, index)"
22
+ >
23
+ {{ getRouteTitle(route) }}
24
+ </ElMenuItem>
25
+ </template>
26
+ </template>
27
+
28
+ <script setup lang="ts">
29
+ import type { propsType, subMenuRouteType } from './_types'
30
+
31
+ import { ElMenuItem, ElSubMenu } from 'element-plus'
32
+
33
+ defineOptions({
34
+ name: 'SubMenu',
35
+ inheritAttrs: false,
36
+ })
37
+
38
+ const props = withDefaults(defineProps<propsType>(), {
39
+ routes: () => [],
40
+ menuHeight: 60,
41
+ })
42
+
43
+ function getRouteKey(route: subMenuRouteType, index: number): string {
44
+ return route.path ?? `${index}`
45
+ }
46
+
47
+ function getRouteTitle(route: subMenuRouteType): string {
48
+ const fallback = route.name ?? ''
49
+ const metaTitle = route.meta?.title ?? ''
50
+ return metaTitle || fallback
51
+ }
52
+
53
+ function getRouteIndex(route: subMenuRouteType, index: number): string {
54
+ return route.path ?? `${index}`
55
+ }
56
+
57
+ function hasChildren(route: subMenuRouteType): boolean {
58
+ return Array.isArray(route.children) && route.children.length > 0
59
+ }
60
+ </script>
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Element Plus UI 组件库 feature 设置 - Qiankun 模式
3
+ * 导入 Element Plus 样式,包括 qiankun 修复
4
+ */
5
+
6
+ import type { App } from 'vue'
7
+ import type { Router } from 'vue-router'
8
+
9
+ // 导入 Element Plus 样式,包括 qiankun 修复
10
+ import '@/assets/styles/element/index.scss'
11
+ import '@/assets/styles/element/fixQiankun.scss'
12
+
13
+ /** 执行顺序 - 样式应该尽早加载 */
14
+ export const order = 5
15
+
16
+ /**
17
+ * 设置 Element Plus
18
+ * @param _app - Vue 应用实例(未使用,样式已导入)
19
+ * @param _router - Vue Router 实例(未使用)
20
+ */
21
+ export function setup(_app: App, _router: Router): void {
22
+ // Element Plus 通过 unplugin-vue-components 自动导入
23
+ // 只需要导入样式
24
+ }
@@ -0,0 +1,6 @@
1
+ import { createPinia } from 'pinia'
2
+ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
3
+
4
+ const store = createPinia()
5
+ store.use(piniaPluginPersistedstate)
6
+ export { store }
@@ -0,0 +1,51 @@
1
+ import { defineStore } from 'pinia'
2
+ import { store } from '../index.ts'
3
+
4
+ /**
5
+ * 系统对象
6
+ * @returns {object} 系统存储对象
7
+ */
8
+ const systemStore = defineStore('system', {
9
+ state: () => ({
10
+ /**
11
+ * 主题颜色
12
+ * @type {string}
13
+ */
14
+ themeColor: '#3a77ff',
15
+ /**
16
+ * 布局
17
+ * @type {string}
18
+ */
19
+ layout: 'element',
20
+ /**
21
+ * 系统编码
22
+ * @type {string}
23
+ */
24
+ systemCode: import.meta.env.VITE_APP_CODE || '',
25
+ }),
26
+ actions: {
27
+ setSystemCode(systemCode: string) {
28
+ // 将当前的主题颜色设置为传入的颜色
29
+ this.systemCode = systemCode
30
+ },
31
+ /**
32
+ * 设置布局
33
+ * @param {string} layout - 新的布局
34
+ */
35
+ setLayout(layout: string) {
36
+ this.layout = layout
37
+ },
38
+ /**
39
+ * 设置主题颜色
40
+ * @param {string} color - 新的主题颜色
41
+ */
42
+ setTheme(color: string) {
43
+ // 将当前的主题颜色设置为传入的颜色
44
+ this.themeColor = color
45
+ },
46
+ },
47
+ })
48
+
49
+ export function useSystemStore() {
50
+ return systemStore(store)
51
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Element Plus Vite 配置 - Qiankun 模式
3
+ * 为 Element Plus 添加 SCSS 命名空间配置
4
+ */
5
+
6
+ /**
7
+ * Vite feature 配置上下文
8
+ */
9
+ interface ViteFeatureContext {
10
+ viteEnv: Record<string, any>
11
+ mode: string
12
+ appCode: string
13
+ }
14
+
15
+ /**
16
+ * 获取 Element Plus Vite 配置
17
+ * @param ctx - feature 配置上下文
18
+ * @param ctx.appCode - 应用代码,用于 SCSS 命名空间
19
+ * @returns Vite UserConfig
20
+ */
21
+ export default ({ appCode }: ViteFeatureContext) => ({
22
+ css: {
23
+ preprocessorOptions: {
24
+ scss: {
25
+ additionalData: (source: string, filename: string) => {
26
+ if (filename.includes('assets/styles/element/index.scss')) {
27
+ return `$namespace: ${appCode || 'el'};
28
+ ${source}`
29
+ }
30
+ return source
31
+ },
32
+ },
33
+ },
34
+ },
35
+ })
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "dependencies": {
3
- "vite-plugin-qiankun": "^1.0.15",
3
+ "lodash-es": "^4.17.21",
4
4
  "radash": "^12.1.0",
5
+ "vite-plugin-qiankun": "^1.0.15",
6
+ "vue": "^3.5.13",
5
7
  "vue-router": "^4.4.5"
8
+ },
9
+ "devDependencies": {
10
+ "@types/lodash-es": "^4.17.12"
6
11
  }
7
12
  }
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "dependencies": {
3
- "vite-plugin-qiankun": "^1.0.15",
3
+ "lodash-es": "^4.17.21",
4
4
  "radash": "^12.1.0",
5
+ "vite-plugin-qiankun": "^1.0.15",
6
+ "vue": "^3.5.13",
5
7
  "vue-router": "^4.4.5"
8
+ },
9
+ "devDependencies": {
10
+ "@types/lodash-es": "^4.17.12"
6
11
  }
7
12
  }