@moluoxixi/create-app 2.0.436 → 2.0.438
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/constants/index.d.ts +5 -0
- package/dist/constants/index.js +8 -0
- package/dist/core/feature.d.ts +26 -20
- package/dist/core/feature.js +47 -52
- package/dist/core/prompts.js +6 -3
- package/dist/core/template.js +1 -1
- package/dist/generators/project.js +8 -0
- package/dist/types/packageJson.d.ts +2 -0
- package/dist/utils/deepMerge.d.ts +1 -1
- package/dist/utils/file.js +6 -2
- package/dist/utils/framework.d.ts +11 -0
- package/dist/utils/framework.js +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +4 -5
- package/templates/common/base/_npmrc +2 -0
- package/templates/common/base/_yarnrc.yml +3 -0
- package/templates/common/base/node_modules/.bin/parser +4 -4
- package/templates/common/base/node_modules/.bin/rollup +4 -4
- package/templates/common/base/node_modules/.bin/sass +2 -2
- package/templates/common/base/node_modules/.bin/terser +4 -4
- package/templates/common/base/node_modules/.bin/vite +2 -2
- package/templates/common/base/package.json +2 -4
- package/templates/common/base/scripts/build.mts +15 -10
- package/templates/common/base/src/apis/request.ts +23 -32
- package/templates/common/base/src/apis/services/example.ts +2 -2
- package/templates/common/base/src/apis/services/user.ts +2 -2
- package/templates/common/base/tsconfig.app.json +25 -0
- package/templates/common/base/tsconfig.base.json +17 -0
- package/templates/common/base/tsconfig.json +11 -0
- package/templates/common/base/tsconfig.node.json +14 -0
- package/templates/common/base/vite/index.ts +19 -18
- package/templates/common/base/vite.config.ts +8 -4
- package/templates/common/features/eslint/node_modules/.bin/sass +17 -0
- package/templates/common/features/eslint/node_modules/.bin/terser +17 -0
- package/templates/common/features/eslint/node_modules/.bin/tsx +17 -0
- package/templates/common/features/eslint/node_modules/.bin/vitest +17 -0
- package/templates/common/features/eslint/node_modules/.bin/yaml +17 -0
- package/templates/common/features/eslint/tsconfig.base.json +17 -0
- package/templates/common/features/eslint/tsconfig.json +8 -0
- package/templates/common/features/eslint/tsconfig.node.json +13 -0
- package/templates/common/features/husky/.husky/pre-commit +1 -1
- package/templates/common/features/husky/node_modules/.bin/commitizen +2 -2
- package/templates/common/features/husky/node_modules/.bin/commitlint +2 -2
- package/templates/common/features/husky/node_modules/.bin/cz +2 -2
- package/templates/common/features/husky/node_modules/.bin/git-cz +2 -2
- package/templates/common/features/husky/tsconfig.base.json +17 -0
- package/templates/common/features/husky/tsconfig.json +8 -0
- package/templates/common/features/husky/tsconfig.node.json +13 -0
- package/templates/react/base/node_modules/.bin/sass +4 -4
- package/templates/react/base/node_modules/.bin/terser +4 -4
- package/templates/react/base/node_modules/.bin/vite +4 -4
- package/templates/react/base/package.json +2 -1
- package/templates/react/base/src/main.tsx +1 -1
- package/templates/react/base/src/router/index.tsx +26 -0
- package/templates/react/base/src/utils/common.ts +126 -0
- package/templates/react/base/src/utils/index.ts +7 -0
- package/templates/react/base/tsconfig.app.json +13 -5
- package/templates/react/base/tsconfig.node.json +6 -7
- package/templates/react/features/ant-design/tsconfig.app.json +25 -0
- package/templates/react/features/ant-design/tsconfig.base.json +22 -0
- package/templates/react/features/ant-design/tsconfig.json +11 -0
- package/templates/react/features/ant-design/tsconfig.node.json +14 -0
- package/templates/react/features/i18n/tsconfig.app.json +25 -0
- package/templates/react/features/i18n/tsconfig.base.json +22 -0
- package/templates/react/features/i18n/tsconfig.json +11 -0
- package/templates/react/features/i18n/tsconfig.node.json +14 -0
- package/templates/react/features/manualRoutes/tsconfig.app.json +25 -0
- package/templates/react/features/manualRoutes/tsconfig.base.json +27 -0
- package/templates/react/features/manualRoutes/tsconfig.json +11 -0
- package/templates/react/features/manualRoutes/tsconfig.node.json +14 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/browserslist +17 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/jiti +17 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/parser +17 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/rollup +17 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/sass +17 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/terser +17 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/tsc +17 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/tsserver +17 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/tsx +17 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/vite +17 -0
- package/templates/react/features/pageRoutes/node_modules/.bin/yaml +17 -0
- package/templates/react/features/pageRoutes/package.json +4 -0
- package/templates/react/features/pageRoutes/tsconfig.app.json +25 -0
- package/templates/react/features/pageRoutes/tsconfig.base.json +27 -0
- package/templates/react/features/pageRoutes/tsconfig.json +11 -0
- package/templates/react/features/pageRoutes/tsconfig.node.json +14 -0
- package/templates/react/features/pageRoutes/vite/features/pageRoutes.ts +15 -0
- package/templates/react/features/sentry/node_modules/.bin/browserslist +17 -0
- package/templates/react/features/sentry/node_modules/.bin/jiti +17 -0
- package/templates/react/features/sentry/node_modules/.bin/parser +17 -0
- package/templates/react/features/sentry/node_modules/.bin/rollup +17 -0
- package/templates/react/features/sentry/node_modules/.bin/sass +17 -0
- package/templates/react/features/sentry/node_modules/.bin/terser +17 -0
- package/templates/react/features/sentry/node_modules/.bin/tsc +17 -0
- package/templates/react/features/sentry/node_modules/.bin/tsserver +17 -0
- package/templates/react/features/sentry/node_modules/.bin/tsx +17 -0
- package/templates/react/features/sentry/node_modules/.bin/vite +17 -0
- package/templates/react/features/sentry/node_modules/.bin/yaml +17 -0
- package/templates/react/features/sentry/package.json +3 -0
- package/templates/react/features/sentry/tsconfig.app.json +25 -0
- package/templates/react/features/sentry/tsconfig.base.json +22 -0
- package/templates/react/features/sentry/tsconfig.json +11 -0
- package/templates/react/features/sentry/tsconfig.node.json +14 -0
- package/templates/react/features/sentry/vite/features/sentry.ts +19 -25
- package/templates/react/features/zustand/tsconfig.app.json +25 -0
- package/templates/react/features/zustand/tsconfig.base.json +27 -0
- package/templates/react/features/zustand/tsconfig.json +11 -0
- package/templates/react/features/zustand/tsconfig.node.json +14 -0
- package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/browserslist +17 -0
- package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/parser +17 -0
- package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/rollup +17 -0
- package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/sass +4 -4
- package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/terser +4 -4
- package/templates/react/micro-frontends/qiankun/base/node_modules/.bin/vite +2 -2
- package/templates/react/micro-frontends/qiankun/base/package.json +2 -1
- package/templates/react/micro-frontends/qiankun/base/src/main.tsx +3 -3
- package/templates/react/micro-frontends/qiankun/base/tsconfig.app.json +25 -0
- package/templates/react/micro-frontends/qiankun/base/tsconfig.base.json +27 -0
- package/templates/react/micro-frontends/qiankun/base/tsconfig.json +11 -0
- package/templates/react/micro-frontends/qiankun/base/tsconfig.node.json +14 -0
- package/templates/react/micro-frontends/qiankun/base/vite/index.ts +19 -18
- package/templates/vue/base/node_modules/.bin/vue-tsc +2 -2
- package/templates/vue/base/package.json +3 -2
- package/templates/vue/base/src/assets/fonts/index.css +6 -0
- package/templates/vue/base/src/assets/styles/base.scss +33 -0
- package/templates/vue/base/src/assets/styles/custom.scss +20 -0
- package/templates/vue/base/src/assets/styles/main.scss +8 -0
- package/templates/vue/base/src/assets/styles/tailwind.scss +3 -0
- package/templates/vue/base/src/main.ts +3 -3
- package/templates/vue/base/src/router/index.ts +25 -0
- package/templates/vue/base/src/utils/common.ts +126 -0
- package/templates/vue/base/src/utils/index.ts +4 -0
- package/templates/vue/base/tsconfig.app.json +10 -3
- package/templates/vue/base/tsconfig.base.json +2 -6
- package/templates/vue/base/tsconfig.json +1 -0
- package/templates/vue/base/tsconfig.node.json +1 -2
- package/templates/vue/features/ant-design-vue/tsconfig.app.json +33 -0
- package/templates/vue/features/ant-design-vue/tsconfig.base.json +25 -0
- package/templates/vue/features/ant-design-vue/tsconfig.json +12 -0
- package/templates/vue/features/ant-design-vue/tsconfig.node.json +14 -0
- package/templates/vue/features/element-plus/node_modules/.bin/browserslist +17 -0
- package/templates/vue/features/element-plus/node_modules/.bin/jiti +17 -0
- package/templates/vue/features/element-plus/node_modules/.bin/parser +17 -0
- package/templates/vue/features/element-plus/node_modules/.bin/rollup +17 -0
- package/templates/vue/features/element-plus/node_modules/.bin/sass +17 -0
- package/templates/vue/features/element-plus/node_modules/.bin/terser +17 -0
- package/templates/vue/features/element-plus/node_modules/.bin/tsx +17 -0
- package/templates/vue/features/element-plus/node_modules/.bin/vite +17 -0
- package/templates/vue/features/element-plus/node_modules/.bin/yaml +17 -0
- package/templates/vue/features/element-plus/package.json +4 -0
- package/templates/vue/features/element-plus/src/assets/styles/main.scss +0 -1
- package/templates/vue/features/element-plus/src/layouts/element.vue +1 -1
- package/templates/vue/features/element-plus/src/stores/modules/system.ts +1 -1
- package/templates/vue/features/element-plus/tsconfig.app.json +33 -0
- package/templates/vue/features/element-plus/tsconfig.base.json +25 -0
- package/templates/vue/features/element-plus/tsconfig.json +12 -0
- package/templates/vue/features/element-plus/tsconfig.node.json +14 -0
- package/templates/vue/features/element-plus/vite/features/element-plus.ts +13 -18
- package/templates/vue/features/i18n/tsconfig.app.json +33 -0
- package/templates/vue/features/i18n/tsconfig.base.json +25 -0
- package/templates/vue/features/i18n/tsconfig.json +12 -0
- package/templates/vue/features/i18n/tsconfig.node.json +14 -0
- package/templates/vue/features/manualRoutes/package.json +2 -1
- package/templates/vue/features/manualRoutes/src/layouts/index.ts +26 -0
- package/templates/vue/features/manualRoutes/src/router/index.ts +1 -1
- package/templates/vue/features/manualRoutes/src/stores/modules/system.ts +1 -1
- package/templates/vue/features/manualRoutes/tsconfig.app.json +33 -0
- package/templates/vue/features/manualRoutes/tsconfig.base.json +25 -0
- package/templates/vue/features/manualRoutes/tsconfig.json +12 -0
- package/templates/vue/features/manualRoutes/tsconfig.node.json +14 -0
- package/templates/vue/features/pageRoutes/node_modules/.bin/browserslist +17 -0
- package/templates/vue/features/pageRoutes/node_modules/.bin/jiti +17 -0
- package/templates/vue/features/pageRoutes/node_modules/.bin/parser +17 -0
- package/templates/vue/features/pageRoutes/node_modules/.bin/rollup +17 -0
- package/templates/vue/features/pageRoutes/node_modules/.bin/sass +17 -0
- package/templates/vue/features/pageRoutes/node_modules/.bin/terser +17 -0
- package/templates/vue/features/pageRoutes/node_modules/.bin/tsx +17 -0
- package/templates/vue/features/pageRoutes/node_modules/.bin/vite +17 -0
- package/templates/vue/features/pageRoutes/node_modules/.bin/yaml +17 -0
- package/templates/vue/features/pageRoutes/package.json +4 -1
- package/templates/vue/features/pageRoutes/src/layouts/index.ts +26 -0
- package/templates/vue/features/pageRoutes/src/stores/modules/system.ts +1 -1
- package/templates/vue/features/pageRoutes/tsconfig.app.json +33 -0
- package/templates/vue/features/pageRoutes/tsconfig.base.json +25 -0
- package/templates/vue/features/pageRoutes/tsconfig.json +12 -0
- package/templates/vue/features/pageRoutes/tsconfig.node.json +14 -0
- package/templates/vue/features/pageRoutes/vite/features/pageRoutes.ts +15 -0
- package/templates/vue/features/pinia/package.json +3 -0
- package/templates/vue/features/pinia/src/stores/modules/system.ts +1 -1
- package/templates/vue/features/pinia/tsconfig.app.json +33 -0
- package/templates/vue/features/pinia/tsconfig.base.json +25 -0
- package/templates/vue/features/pinia/tsconfig.json +12 -0
- package/templates/vue/features/pinia/tsconfig.node.json +14 -0
- package/templates/vue/features/sentry/node_modules/.bin/browserslist +17 -0
- package/templates/vue/features/sentry/node_modules/.bin/jiti +17 -0
- package/templates/vue/features/sentry/node_modules/.bin/parser +17 -0
- package/templates/vue/features/sentry/node_modules/.bin/rollup +17 -0
- package/templates/vue/features/sentry/node_modules/.bin/sass +17 -0
- package/templates/vue/features/sentry/node_modules/.bin/terser +17 -0
- package/templates/vue/features/sentry/node_modules/.bin/tsx +17 -0
- package/templates/vue/features/sentry/node_modules/.bin/vite +17 -0
- package/templates/vue/features/sentry/node_modules/.bin/yaml +17 -0
- package/templates/vue/features/sentry/package.json +3 -0
- package/templates/vue/features/sentry/tsconfig.app.json +33 -0
- package/templates/vue/features/sentry/tsconfig.base.json +25 -0
- package/templates/vue/features/sentry/tsconfig.json +12 -0
- package/templates/vue/features/sentry/tsconfig.node.json +14 -0
- package/templates/vue/features/sentry/vite/features/sentry.ts +19 -25
- package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/browserslist +17 -0
- package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/jiti +2 -2
- package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/parser +17 -0
- package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/rollup +17 -0
- package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/sass +4 -4
- package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/terser +4 -4
- package/templates/vue/micro-frontends/qiankun/base/node_modules/.bin/vite +2 -2
- package/templates/vue/micro-frontends/qiankun/base/package.json +6 -1
- package/templates/vue/micro-frontends/qiankun/base/src/App.vue +13 -0
- package/templates/vue/micro-frontends/qiankun/base/src/assets/fonts/index.css +6 -0
- package/templates/vue/micro-frontends/qiankun/base/src/assets/styles/base.scss +33 -0
- package/templates/vue/micro-frontends/qiankun/base/src/assets/styles/custom.scss +20 -0
- package/templates/vue/micro-frontends/qiankun/base/src/assets/styles/main.scss +8 -0
- package/templates/vue/micro-frontends/qiankun/base/src/assets/styles/tailwind.scss +3 -0
- package/templates/vue/micro-frontends/qiankun/base/src/directives/index.ts +36 -0
- package/templates/vue/micro-frontends/qiankun/base/src/main.ts +5 -5
- package/templates/vue/micro-frontends/qiankun/base/src/router/index.ts +27 -0
- package/templates/vue/micro-frontends/qiankun/base/src/stores/index.ts +8 -0
- package/templates/vue/micro-frontends/qiankun/base/tsconfig.app.json +33 -0
- package/templates/vue/micro-frontends/qiankun/base/tsconfig.base.json +25 -0
- package/templates/vue/micro-frontends/qiankun/base/tsconfig.json +12 -0
- package/templates/vue/micro-frontends/qiankun/base/tsconfig.node.json +14 -0
- package/templates/vue/micro-frontends/qiankun/base/vite/index.ts +19 -18
- package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/browserslist +17 -0
- package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/parser +17 -0
- package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/rollup +17 -0
- package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/sass +4 -4
- package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/terser +4 -4
- package/templates/vue/micro-frontends/qiankun/features/element-plus/node_modules/.bin/vite +4 -4
- package/templates/vue/micro-frontends/qiankun/features/element-plus/package.json +4 -0
- package/templates/vue/micro-frontends/qiankun/features/element-plus/src/assets/styles/main.scss +0 -1
- package/templates/vue/micro-frontends/qiankun/features/element-plus/src/stores/modules/system.ts +1 -1
- package/templates/vue/micro-frontends/qiankun/features/element-plus/tsconfig.app.json +33 -0
- package/templates/vue/micro-frontends/qiankun/features/element-plus/tsconfig.base.json +25 -0
- package/templates/vue/micro-frontends/qiankun/features/element-plus/tsconfig.json +12 -0
- package/templates/vue/micro-frontends/qiankun/features/element-plus/tsconfig.node.json +14 -0
- package/templates/vue/micro-frontends/qiankun/features/element-plus/vite/features/element-plus.ts +13 -18
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/sass +4 -4
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/terser +4 -4
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/node_modules/.bin/vite +4 -4
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/package.json +2 -1
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/src/layouts/index.ts +26 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/src/stores/modules/system.ts +1 -1
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/tsconfig.app.json +33 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/tsconfig.base.json +25 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/tsconfig.json +12 -0
- package/templates/vue/micro-frontends/qiankun/features/manualRoutes/tsconfig.node.json +14 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/browserslist +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/parser +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/rollup +17 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/sass +4 -4
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/terser +4 -4
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/node_modules/.bin/vite +4 -4
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/package.json +4 -1
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/src/stores/modules/system.ts +1 -1
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/tsconfig.app.json +33 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/tsconfig.base.json +25 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/tsconfig.json +12 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/tsconfig.node.json +14 -0
- package/templates/vue/micro-frontends/qiankun/features/pageRoutes/vite/features/pageRoutes.ts +15 -0
- package/dist/test.d.ts +0 -5
- package/dist/test.js +0 -508
- package/templates/common/base/src/utils/index.ts +0 -87
- /package/templates/vue/features/element-plus/src/assets/styles/{element.scss → element/index.scss} +0 -0
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 工具函数
|
|
3
|
-
* 通用工具方法
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 延迟执行
|
|
8
|
-
* @param ms 延迟毫秒数
|
|
9
|
-
* @returns Promise,在指定时间后 resolve
|
|
10
|
-
*/
|
|
11
|
-
export function sleep(ms: number): Promise<void> {
|
|
12
|
-
return new Promise(resolve => setTimeout(resolve, ms))
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 深拷贝
|
|
17
|
-
* @param obj 要拷贝的对象
|
|
18
|
-
* @returns 深拷贝后的新对象
|
|
19
|
-
*/
|
|
20
|
-
export function deepClone<T>(obj: T): T {
|
|
21
|
-
return JSON.parse(JSON.stringify(obj))
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 防抖函数
|
|
26
|
-
* @param fn 要防抖的函数
|
|
27
|
-
* @param delay 延迟时间(毫秒)
|
|
28
|
-
* @returns 防抖后的函数
|
|
29
|
-
*/
|
|
30
|
-
export function debounce<T extends (...args: unknown[]) => unknown>(
|
|
31
|
-
fn: T,
|
|
32
|
-
delay: number,
|
|
33
|
-
): (...args: Parameters<T>) => void {
|
|
34
|
-
let timer: ReturnType<typeof setTimeout> | null = null
|
|
35
|
-
return function (this: unknown, ...args: Parameters<T>) {
|
|
36
|
-
if (timer) {
|
|
37
|
-
clearTimeout(timer)
|
|
38
|
-
}
|
|
39
|
-
timer = setTimeout(() => {
|
|
40
|
-
fn.apply(this, args)
|
|
41
|
-
}, delay)
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* 节流函数
|
|
47
|
-
* @param fn 要节流的函数
|
|
48
|
-
* @param delay 间隔时间(毫秒)
|
|
49
|
-
* @returns 节流后的函数
|
|
50
|
-
*/
|
|
51
|
-
export function throttle<T extends (...args: unknown[]) => unknown>(
|
|
52
|
-
fn: T,
|
|
53
|
-
delay: number,
|
|
54
|
-
): (...args: Parameters<T>) => void {
|
|
55
|
-
let lastTime = 0
|
|
56
|
-
return function (this: unknown, ...args: Parameters<T>) {
|
|
57
|
-
const now = Date.now()
|
|
58
|
-
if (now - lastTime >= delay) {
|
|
59
|
-
lastTime = now
|
|
60
|
-
fn.apply(this, args)
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* 格式化日期
|
|
67
|
-
* @param date 日期(Date 对象、时间戳或日期字符串)
|
|
68
|
-
* @param format 格式字符串,默认为 'YYYY-MM-DD HH:mm:ss'
|
|
69
|
-
* @returns 格式化后的日期字符串
|
|
70
|
-
*/
|
|
71
|
-
export function formatDate(date: Date | string | number, format = 'YYYY-MM-DD HH:mm:ss'): string {
|
|
72
|
-
const d = new Date(date)
|
|
73
|
-
const year = d.getFullYear()
|
|
74
|
-
const month = String(d.getMonth() + 1).padStart(2, '0')
|
|
75
|
-
const day = String(d.getDate()).padStart(2, '0')
|
|
76
|
-
const hours = String(d.getHours()).padStart(2, '0')
|
|
77
|
-
const minutes = String(d.getMinutes()).padStart(2, '0')
|
|
78
|
-
const seconds = String(d.getSeconds()).padStart(2, '0')
|
|
79
|
-
|
|
80
|
-
return format
|
|
81
|
-
.replace('YYYY', String(year))
|
|
82
|
-
.replace('MM', month)
|
|
83
|
-
.replace('DD', day)
|
|
84
|
-
.replace('HH', hours)
|
|
85
|
-
.replace('mm', minutes)
|
|
86
|
-
.replace('ss', seconds)
|
|
87
|
-
}
|
/package/templates/vue/features/element-plus/src/assets/styles/{element.scss → element/index.scss}
RENAMED
|
File without changes
|