ljr-cli 1.0.0 → 1.0.1
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/lib/demo1.js +36 -0
- package/lib/demo2.js +85 -0
- package/lib/index.js +183 -14
- package/lib/templates/flutter//346/210/221/346/230/257flutter.txt +0 -0
- package/lib/templates/java//346/210/221/346/230/257java.txt +0 -0
- package/lib/templates/monorepo//346/210/221/346/230/257monorepo.txt +0 -0
- package/lib/templates/mysql//346/210/221/346/230/257mysql.txt +0 -0
- package/lib/templates/node//346/210/221/346/230/257node.txt +0 -0
- package/lib/templates/qiankun//346/210/221/346/230/257qiankun.txt +0 -0
- package/lib/templates/react//346/210/221/346/230/257react.txt +0 -0
- package/lib/templates/uni-app//346/210/221/346/230/257uni-app.txt +0 -0
- package/lib/templates/vue2.7.16/.browserslistrc +3 -0
- package/lib/templates/vue2.7.16/.env +4 -0
- package/lib/templates/vue2.7.16/.env.development +7 -0
- package/lib/templates/vue2.7.16/.env.production +7 -0
- package/lib/templates/vue2.7.16/.eslintignore +3 -0
- package/lib/templates/vue2.7.16/.eslintrc.js +21 -0
- package/lib/templates/vue2.7.16/.prettierrc.js +11 -0
- package/lib/templates/vue2.7.16/.vscode/settings.json +10 -0
- package/lib/templates/vue2.7.16/README.md +55 -0
- package/lib/templates/vue2.7.16/babel.config.js +3 -0
- package/lib/templates/vue2.7.16/jsconfig.json +19 -0
- package/lib/templates/vue2.7.16/package-lock.json +12422 -0
- package/lib/templates/vue2.7.16/package.json +37 -0
- package/lib/templates/vue2.7.16/public/favicon.svg +14 -0
- package/lib/templates/vue2.7.16/public/index.html +20 -0
- package/lib/templates/vue2.7.16/src/App.vue +14 -0
- package/lib/templates/vue2.7.16/src/api/interface/index.js +6 -0
- package/lib/templates/vue2.7.16/src/api/request.js +121 -0
- package/lib/templates/vue2.7.16/src/api/server/index.js +6 -0
- package/lib/templates/vue2.7.16/src/assets/logo.png +0 -0
- package/lib/templates/vue2.7.16/src/components/README.md +5 -0
- package/lib/templates/vue2.7.16/src/components/baseInfo/index.vue +29 -0
- package/lib/templates/vue2.7.16/src/components/baseInfo/item.vue +64 -0
- package/lib/templates/vue2.7.16/src/components/index.js +14 -0
- package/lib/templates/vue2.7.16/src/components/layout/left-menu-and-top-info.vue +121 -0
- package/lib/templates/vue2.7.16/src/components/pagination/index.vue +52 -0
- package/lib/templates/vue2.7.16/src/css/coverage-style.css +6 -0
- package/lib/templates/vue2.7.16/src/directive/index.js +16 -0
- package/lib/templates/vue2.7.16/src/directive/input-number.js +18 -0
- package/lib/templates/vue2.7.16/src/directive/permission.js +52 -0
- package/lib/templates/vue2.7.16/src/directive/re-click.js +12 -0
- package/lib/templates/vue2.7.16/src/global-config.js +12 -0
- package/lib/templates/vue2.7.16/src/main.js +79 -0
- package/lib/templates/vue2.7.16/src/prototype/README.md +1 -0
- package/lib/templates/vue2.7.16/src/prototype/el-dialog.js +127 -0
- package/lib/templates/vue2.7.16/src/prototype/index.js +53 -0
- package/lib/templates/vue2.7.16/src/router/index.js +257 -0
- package/lib/templates/vue2.7.16/src/store/index.js +50 -0
- package/lib/templates/vue2.7.16/src/store/modules/dd.js +128 -0
- package/lib/templates/vue2.7.16/src/store/modules/permissions.js +24 -0
- package/lib/templates/vue2.7.16/src/views/404.vue +7 -0
- package/lib/templates/vue2.7.16/src/views/Pitfalls//345/206/205/345/255/230/346/272/242/345/207/272/index.vue +56 -0
- package/lib/templates/vue2.7.16/src/views/Pitfalls//345/206/205/345/255/230/346/272/242/345/207/272//351/200/240/346/210/220vue2/345/206/205/345/255/230/346/272/242/345/207/272/347/232/204/345/257/271/350/261/241.js +33518 -0
- package/lib/templates/vue2.7.16/src/views/about.vue +5 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200store/346/225/260/346/215/256/345/255/227/345/205/270/index.vue +85 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200/345/274/271/347/252/227/ce.vue +42 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200/345/274/271/347/252/227/index.vue +24 -0
- package/lib/templates/vue2.7.16/src/views/demo//345/205/250/345/261/200/346/214/207/344/273/244/index.vue +78 -0
- package/lib/templates/vue2.7.16/src/views/demo//350/257/267/346/261/202/347/244/272/344/276/213/index.vue +51 -0
- package/lib/templates/vue2.7.16/src/views/home.vue +3 -0
- package/lib/templates/vue2.7.16/src/views/login.vue +67 -0
- package/lib/templates/vue2.7.16/src/views/template/base-info.vue +29 -0
- package/lib/templates/vue2.7.16/src/views/template/base-info2.vue +56 -0
- package/lib/templates/vue2.7.16/src/views/template/list/ce.vue +58 -0
- package/lib/templates/vue2.7.16/src/views/template/list/index.vue +111 -0
- package/lib/templates/vue2.7.16/src/views/template/list/search.vue +60 -0
- package/lib/templates/vue2.7.16/vue.config.js +26 -0
- package/lib/templates/vue3.5.25-2025.12.4/.editorconfig +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/.gitattributes +1 -0
- package/lib/templates/vue3.5.25-2025.12.4/.prettierrc.json +11 -0
- package/lib/templates/vue3.5.25-2025.12.4/.vscode/extensions.json +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/.vscode/settings.json +13 -0
- package/lib/templates/vue3.5.25-2025.12.4/README.md +75 -0
- package/lib/templates/vue3.5.25-2025.12.4/env.d.ts +1 -0
- package/lib/templates/vue3.5.25-2025.12.4/eslint.config.ts +32 -0
- package/lib/templates/vue3.5.25-2025.12.4/index.html +13 -0
- package/lib/templates/vue3.5.25-2025.12.4/package-lock.json +5297 -0
- package/lib/templates/vue3.5.25-2025.12.4/package.json +44 -0
- package/lib/templates/vue3.5.25-2025.12.4/public/favicon.svg +14 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/App.vue +16 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/assets/vue.svg +1 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/element-plus.ts +13 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/index.ts +16 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/pinia.ts +10 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/router.ts +10 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/boot/style.ts +9 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/css/coverage-style.css +6 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/directive/index.js +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/directive/rememberScrollPosition.ts +17 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/main.ts +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/router/index.ts +20 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/stores/counter.ts +12 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/views/AboutView.vue +3 -0
- package/lib/templates/vue3.5.25-2025.12.4/src/views/HomeView.vue +8 -0
- package/lib/templates/vue3.5.25-2025.12.4/tsconfig.app.json +13 -0
- package/lib/templates/vue3.5.25-2025.12.4/tsconfig.json +11 -0
- package/lib/templates/vue3.5.25-2025.12.4/tsconfig.node.json +19 -0
- package/lib/templates/vue3.5.25-2025.12.4/vite.config.ts +17 -0
- package/lib/templates/wx-miniapp//346/210/221/346/230/257wx-miniapp.txt +0 -0
- package/lib/utils/date.js +148 -0
- package/package.json +11 -3
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vue3.5.25-2025.12.4",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "vite --host",
|
|
11
|
+
"serve": "vite --host",
|
|
12
|
+
"build": "run-p type-check \"build-only {@}\" --",
|
|
13
|
+
"preview": "vite preview",
|
|
14
|
+
"build-only": "vite build",
|
|
15
|
+
"type-check": "vue-tsc --build",
|
|
16
|
+
"lint": "eslint . --fix --cache",
|
|
17
|
+
"format": "prettier --write --experimental-cli src/"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"element-plus": "^2.12.0",
|
|
21
|
+
"l-global": "^1.0.2",
|
|
22
|
+
"pinia": "^3.0.4",
|
|
23
|
+
"vue": "^3.5.25",
|
|
24
|
+
"vue-router": "^4.6.3"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@tsconfig/node24": "^24.0.3",
|
|
28
|
+
"@types/node": "^24.10.1",
|
|
29
|
+
"@vitejs/plugin-vue": "^6.0.2",
|
|
30
|
+
"@vitejs/plugin-vue-jsx": "^5.1.2",
|
|
31
|
+
"@vue/eslint-config-prettier": "^10.2.0",
|
|
32
|
+
"@vue/eslint-config-typescript": "^14.6.0",
|
|
33
|
+
"@vue/tsconfig": "^0.8.1",
|
|
34
|
+
"eslint": "^9.39.1",
|
|
35
|
+
"eslint-plugin-vue": "~10.5.1",
|
|
36
|
+
"jiti": "^2.6.1",
|
|
37
|
+
"npm-run-all2": "^8.0.4",
|
|
38
|
+
"prettier": "3.6.2",
|
|
39
|
+
"typescript": "~5.9.0",
|
|
40
|
+
"vite": "^7.2.4",
|
|
41
|
+
"vite-plugin-vue-devtools": "^8.0.5",
|
|
42
|
+
"vue-tsc": "^3.1.5"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg width="178" height="163" viewBox="0 0 178 163" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g clip-path="url(#clip0_7002_5844)">
|
|
3
|
+
<path d="M170.41 58.9201C163.95 62.5901 160.77 63.0901 159.13 63.4801C148.67 65.9301 154.69 60.7301 155.82 60.0001C186.84 40.0601 176.7 23.8901 173 18.8101C169.25 13.6601 167.33 10.7601 165.53 6.99014C163.82 3.40014 163.09 1.93014 162.36 2.58014C161.03 3.76014 162.39 10.2501 166.08 17.6401C169.12 23.7301 169.53 27.7101 166.7 29.1501C164.18 30.4401 160.27 30.3101 156.07 27.2601C150.6 23.5301 149.32 10.8801 149.66 3.85014C149.87 -0.489863 148.68 -0.809863 147.95 1.14014C146.49 5.04014 145.68 11.8401 146.03 18.3501C146.46 26.2901 150.68 31.9501 156.94 38.1701C163.69 45.2201 159.21 51.6801 149.22 55.4001C133.29 61.3301 123.69 54.4301 118.69 46.8601C116.7 43.8401 114.93 43.5501 115.22 46.3201C115.59 49.7601 117.95 53.9501 119.97 58.3601C123.61 66.3001 119.82 71.6501 112.62 74.5401C106.6 76.9601 100.42 73.0201 97.28 69.4601C95.68 67.6501 93.25 69.1801 100.27 80.3901C101.83 82.8901 101.83 84.0301 100.68 85.3301C98.41 83.3601 96.41 82.4501 96.41 82.4501C98 79.5201 95.27 76.3201 95.27 76.3201C95.27 76.3201 95.47 77.7001 93.86 78.8901C94.02 75.5001 90.38 73.2501 90.38 73.2501C90.38 73.2501 91.54 77.4701 86.77 79.0501C85.17 79.5801 84.06 80.4101 83.5 81.7001C82.26 82.0201 81.05 82.4601 79.9 83.0001C78.69 83.4401 77.59 84.0901 76.6 84.9101C75.8 83.7601 75.94 82.6201 77.33 80.3801C84.35 69.1701 81.92 67.6401 80.32 69.4501C77.17 73.0201 71 76.9501 64.97 74.5301C57.77 71.6401 53.99 66.2901 57.62 58.3501C59.64 53.9401 62 49.7501 62.37 46.3101C62.66 43.5401 60.89 43.8301 58.9 46.8501C53.91 54.4301 44.3 61.3201 28.37 55.3901C18.37 51.6701 13.89 45.2201 20.65 38.1601C26.91 31.9501 31.13 26.2801 31.56 18.3401C31.91 11.8301 31.1 5.03014 29.64 1.13014C28.91 -0.819863 27.71 -0.499863 27.92 3.84014C28.26 10.8801 26.98 23.5301 21.51 27.2501C17.31 30.3001 13.41 30.4301 10.88 29.1401C8.05 27.6901 8.45 23.7201 11.5 17.6301C15.19 10.2501 16.55 3.76014 15.22 2.57014C14.49 1.92014 13.76 3.39014 12.05 6.98014C10.26 10.7501 8.34 13.6501 4.59 18.8001C0.889998 23.8701 -9.25 40.0501 21.77 59.9901C22.9 60.7101 28.92 65.9201 18.46 63.4701C16.82 63.0901 13.63 62.5801 7.18 58.9101C5.59 58.0101 1.81 56.8501 3.63 59.4101C7.28 64.5401 18.44 69.6701 34.37 70.6301C39.5 70.7601 54.01 76.4201 63.74 85.8501C63.68 85.8301 63.63 85.8001 63.57 85.7701C57.47 83.5301 55.22 85.7701 55.22 85.7701C53.45 87.3201 57.63 89.7701 60.2 95.0501C63.93 101.84 69.69 101.74 70.89 101.64C71.01 102.1 71.16 102.53 71.35 102.92C70.95 104.04 70.65 105.33 70.59 106.73C70.38 111.66 67.34 112.75 65.29 113.85C65.29 113.85 67.61 116.59 70.08 115.6C70.08 115.6 68.43 120.42 64.22 122.17C64.22 122.17 65.66 124.03 68.13 122.72C68.13 122.72 61.8 130.36 58.57 135.02L54.27 136.77H54.25V150.48H71.34C78.05 156.52 86.06 162.55 91.32 162.55C96.58 162.55 104.59 156.52 111.3 150.48H126.49V136.77H126.47L117.79 133.24C114.41 128.64 109.5 122.72 109.5 122.72C111.97 124.03 113.41 122.17 113.41 122.17C109.19 120.42 107.55 115.6 107.55 115.6C110.02 116.58 112.34 113.85 112.34 113.85C110.28 112.75 107.24 111.66 107.03 106.73C106.97 105.33 106.67 104.04 106.27 102.92C106.45 102.51 106.6 102.09 106.74 101.66C108.59 101.69 113.58 101.15 116.93 95.0501C119.5 89.7701 123.68 87.3101 121.91 85.7701C121.91 85.7701 119.81 83.7001 114.18 85.5601C123.9 76.3001 138.17 70.7601 143.25 70.6201C159.17 69.6601 170.34 64.5401 173.99 59.4001C175.81 56.8401 172.03 58.0001 170.44 58.9001L170.41 58.9201ZM79.52 87.2701C71.62 100.48 86.02 94.0401 85.51 102.99C85.01 111.94 85.3 117 88.93 119.01C92.56 121.02 96.49 120.72 91.75 121.62C87.01 122.53 86 118.5 84.59 124.94C83.18 131.38 95.58 129.46 93.06 131.27C90.54 133.08 85.9 131.87 83.38 131.27C80.86 130.66 81.77 129.36 80.56 126.24C79.35 123.12 75.52 120.91 75.52 120.91C76.23 118.6 74.71 113.77 76.23 114.98C77.74 116.19 82.38 118.2 82.28 117.6C82.18 116.99 81.47 117.1 80.37 114.98C79.26 112.87 77.38 111.39 75.9 109.92C74.42 108.44 77.65 106.43 76.57 103.89C75.49 101.34 72.4 101.34 72.4 101.34C69.44 89.8101 79.53 87.2601 79.53 87.2601L79.52 87.2701ZM124.13 139.11V148.19H122.74V146.21H121.27V148.19H118.52V147.01H117.05V148.19H114.3V147.01H112.83V148.19H110.08V147.01H108.61V148.19H105.86V147.01H104.39V148.19H101.64V146.21H100.17V148.19H97.42V147.01H95.95V148.19H93.2V147.01H91.73V148.19H88.98V147.01H87.51V148.19H84.76V147.01H83.29V148.19H80.54V146.21H79.07V148.19H76.32V147.01H74.85V148.19H72.1V147.01H70.63V148.19H67.88V147.01H66.41V148.19H63.66V147.01H62.19V148.19H59.44V146.21H57.97V148.19H56.58V139.11H124.17H124.13Z" fill="black"/>
|
|
4
|
+
<path d="M76.5 145.55H75.47V140.99L74.24 141.63V140.55L75.66 139.83H76.5V145.55Z" fill="black"/>
|
|
5
|
+
<path d="M84.86 139.97C85.17 140.13 85.41 140.36 85.59 140.65C85.76 140.94 85.85 141.27 85.85 141.65C85.85 141.89 85.83 142.1 85.78 142.28C85.73 142.46 85.67 142.63 85.6 142.79C85.53 142.95 85.39 143.18 85.21 143.49L84.03 145.55H82.81L84.07 143.46L84.05 143.44C83.89 143.51 83.7 143.54 83.5 143.54C83.18 143.54 82.88 143.46 82.61 143.31C82.34 143.16 82.12 142.94 81.97 142.65C81.82 142.36 81.73 142.04 81.73 141.68C81.73 141.3 81.82 140.96 82 140.66C82.18 140.36 82.42 140.13 82.74 139.97C83.06 139.81 83.41 139.72 83.81 139.72C84.21 139.72 84.55 139.8 84.86 139.97ZM84.5 142.35C84.69 142.17 84.79 141.94 84.79 141.65C84.79 141.36 84.7 141.12 84.51 140.93C84.32 140.74 84.08 140.65 83.78 140.65C83.48 140.65 83.25 140.74 83.06 140.93C82.87 141.12 82.78 141.35 82.78 141.65C82.78 141.95 82.87 142.17 83.05 142.35C83.23 142.53 83.46 142.62 83.75 142.62C84.05 142.62 84.3 142.53 84.5 142.35Z" fill="black"/>
|
|
6
|
+
<path d="M93.67 139.97C93.98 140.13 94.22 140.36 94.4 140.65C94.57 140.94 94.66 141.27 94.66 141.65C94.66 141.89 94.64 142.1 94.59 142.28C94.54 142.46 94.48 142.63 94.41 142.79C94.34 142.95 94.2 143.18 94.02 143.49L92.84 145.55H91.62L92.88 143.46L92.86 143.44C92.7 143.51 92.51 143.54 92.31 143.54C91.99 143.54 91.69 143.46 91.42 143.31C91.15 143.16 90.93 142.94 90.78 142.65C90.63 142.36 90.54 142.04 90.54 141.68C90.54 141.3 90.63 140.96 90.81 140.66C90.99 140.36 91.23 140.13 91.55 139.97C91.87 139.81 92.22 139.72 92.62 139.72C93.02 139.72 93.36 139.8 93.67 139.97ZM93.31 142.35C93.5 142.17 93.6 141.94 93.6 141.65C93.6 141.36 93.51 141.12 93.32 140.93C93.13 140.74 92.89 140.65 92.59 140.65C92.29 140.65 92.06 140.74 91.87 140.93C91.68 141.12 91.59 141.35 91.59 141.65C91.59 141.95 91.68 142.17 91.86 142.35C92.04 142.53 92.27 142.62 92.56 142.62C92.86 142.62 93.11 142.53 93.31 142.35Z" fill="black"/>
|
|
7
|
+
<path d="M101.59 142.09H101.72C102 142.09 102.26 142.15 102.51 142.29C102.76 142.43 102.95 142.63 103.1 142.88C103.25 143.13 103.32 143.44 103.32 143.79C103.32 144.14 103.24 144.48 103.07 144.76C102.9 145.04 102.67 145.26 102.37 145.41C102.07 145.56 101.73 145.64 101.34 145.64C100.88 145.64 100.48 145.53 100.14 145.31C99.8 145.09 99.55 144.8 99.38 144.44L100.19 143.89C100.32 144.16 100.48 144.36 100.66 144.5C100.85 144.64 101.07 144.71 101.34 144.71C101.61 144.71 101.85 144.63 102.02 144.46C102.19 144.29 102.28 144.07 102.28 143.79C102.28 143.51 102.19 143.28 102.02 143.11C101.85 142.94 101.61 142.86 101.32 142.84C101.13 142.84 100.93 142.9 100.73 143.02L100.17 142.29L101.66 140.77H99.57V139.81H103.02V140.65L101.56 142.03L101.58 142.07L101.59 142.09Z" fill="black"/>
|
|
8
|
+
</g>
|
|
9
|
+
<defs>
|
|
10
|
+
<clipPath id="clip0_7002_5844">
|
|
11
|
+
<rect width="177.56" height="162.58" fill="white"/>
|
|
12
|
+
</clipPath>
|
|
13
|
+
</defs>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { App } from "vue"
|
|
2
|
+
|
|
3
|
+
// 引入ElementPlus
|
|
4
|
+
import "element-plus/dist/index.css"
|
|
5
|
+
import ElementPlus from "element-plus"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 初始化ElementPlus
|
|
9
|
+
* @param app vue上下文
|
|
10
|
+
*/
|
|
11
|
+
export function setupElementPlus(app: App<Element>) {
|
|
12
|
+
app.use(ElementPlus)
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { App } from "vue"
|
|
2
|
+
import { setupStyle } from "./style"
|
|
3
|
+
import { setupElementPlus } from "./element-plus"
|
|
4
|
+
import { setupRouter } from "./router"
|
|
5
|
+
import { setupPinia } from "./pinia"
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 初始化启动时,安装对应实例
|
|
9
|
+
* @param app vue上下文
|
|
10
|
+
*/
|
|
11
|
+
export function setupBoot(app: App<Element>) {
|
|
12
|
+
setupStyle(app)
|
|
13
|
+
setupElementPlus(app)
|
|
14
|
+
setupRouter(app)
|
|
15
|
+
setupPinia(app)
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
// 当绑定元素挂载时
|
|
3
|
+
mounted(el: HTMLElement) {
|
|
4
|
+
el.dataset.scrollTop = "0"
|
|
5
|
+
el.addEventListener("scroll", function () {
|
|
6
|
+
// 将滚动位置保存在元素的dataset属性中
|
|
7
|
+
el.dataset.scrollTop = el.scrollTop + ""
|
|
8
|
+
})
|
|
9
|
+
},
|
|
10
|
+
// 当绑定的Vue组件的视图更新时
|
|
11
|
+
update(el: HTMLElement) {
|
|
12
|
+
// 如果有保存的滚动位置,则恢复它
|
|
13
|
+
if (el.dataset.scrollTop) {
|
|
14
|
+
el.scrollTop = parseInt(el.dataset.scrollTop, 10)
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRouter, createWebHashHistory } from "vue-router"
|
|
2
|
+
import HomeView from "../views/HomeView.vue"
|
|
3
|
+
|
|
4
|
+
const router = createRouter({
|
|
5
|
+
history: createWebHashHistory(import.meta.env.BASE_URL),
|
|
6
|
+
routes: [
|
|
7
|
+
{
|
|
8
|
+
path: "/",
|
|
9
|
+
name: "home",
|
|
10
|
+
component: HomeView,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
path: "/about",
|
|
14
|
+
name: "about",
|
|
15
|
+
component: () => import("../views/AboutView.vue"),
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
export default router
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ref, computed } from "vue"
|
|
2
|
+
import { defineStore } from "pinia"
|
|
3
|
+
|
|
4
|
+
export const useCounterStore = defineStore("counter", () => {
|
|
5
|
+
const count = ref(0)
|
|
6
|
+
const doubleCount = computed(() => count.value * 2)
|
|
7
|
+
function increment() {
|
|
8
|
+
count.value++
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return { count, doubleCount, increment }
|
|
12
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
+
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
|
|
4
|
+
"exclude": ["src/**/__tests__/*"],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
7
|
+
|
|
8
|
+
"paths": {
|
|
9
|
+
"@/*": ["./src/*"]
|
|
10
|
+
},
|
|
11
|
+
"types": ["element-plus/global"]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@tsconfig/node24/tsconfig.json",
|
|
3
|
+
"include": [
|
|
4
|
+
"vite.config.*",
|
|
5
|
+
"vitest.config.*",
|
|
6
|
+
"cypress.config.*",
|
|
7
|
+
"nightwatch.conf.*",
|
|
8
|
+
"playwright.config.*",
|
|
9
|
+
"eslint.config.*"
|
|
10
|
+
],
|
|
11
|
+
"compilerOptions": {
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
14
|
+
|
|
15
|
+
"module": "ESNext",
|
|
16
|
+
"moduleResolution": "Bundler",
|
|
17
|
+
"types": ["node"]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from "node:url"
|
|
2
|
+
|
|
3
|
+
import { defineConfig } from "vite"
|
|
4
|
+
import vue from "@vitejs/plugin-vue"
|
|
5
|
+
import vueJsx from "@vitejs/plugin-vue-jsx"
|
|
6
|
+
import vueDevTools from "vite-plugin-vue-devtools"
|
|
7
|
+
|
|
8
|
+
// https://vite.dev/config/
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
base: "./", // 公共路径
|
|
11
|
+
plugins: [vue(), vueJsx(), vueDevTools()],
|
|
12
|
+
resolve: {
|
|
13
|
+
alias: {
|
|
14
|
+
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
})
|
|
File without changes
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// import { dateFormat } from "@/l-global/js/utils/date.js"
|
|
2
|
+
|
|
3
|
+
/** 时间戳 转 日期对象,有一些后端给的数据需要乘1000,有一些不需要
|
|
4
|
+
* @param { String | Number } timestamp 时间戳
|
|
5
|
+
* @return { Date } 日期对象
|
|
6
|
+
* @example
|
|
7
|
+
* timestampToDate('1484222693') // 需要 * 1000
|
|
8
|
+
* timestampToDate('1697694251000') // 不需要 * 1000
|
|
9
|
+
*/
|
|
10
|
+
export function timestampToDate(timestamp, needMultiply = false) {
|
|
11
|
+
const date = new Date()
|
|
12
|
+
date.setTime(timestamp * (needMultiply ? 1000 : 1))
|
|
13
|
+
return date
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** 日期对象 转 时间戳
|
|
17
|
+
* @param { Date } date 日期对象
|
|
18
|
+
* @return { Number } 时间戳
|
|
19
|
+
* @example
|
|
20
|
+
* dateToTimestamp(new Date())
|
|
21
|
+
*/
|
|
22
|
+
export function dateToTimestamp(date) {
|
|
23
|
+
return Date.parse(date)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** 日期对象 转 指定的日期时间格式
|
|
27
|
+
* @param { Date } date 时间对象
|
|
28
|
+
* @param { String } format 格式
|
|
29
|
+
* @returns { String } 日期时间字符串
|
|
30
|
+
* @example
|
|
31
|
+
* var now = new Date() // Mon Jan 16 2017 14:32:22 GMT+0800 (中国标准时间)
|
|
32
|
+
* dateFormat(now, 'yyyy-MM-dd h:m:s S') // 2017-1-16 14:32:22 789
|
|
33
|
+
* dateFormat(now, 'yyyy-MM-dd hh:mm:ss S') // 2017-01-16 14:32:22 789
|
|
34
|
+
*/
|
|
35
|
+
export function dateFormat(date = new Date(), format = "yyyy-MM-dd hh:mm:ss") {
|
|
36
|
+
const time = {
|
|
37
|
+
"M+": date.getMonth() + 1,
|
|
38
|
+
"d+": date.getDate(),
|
|
39
|
+
"h+": date.getHours(),
|
|
40
|
+
"m+": date.getMinutes(),
|
|
41
|
+
"s+": date.getSeconds(),
|
|
42
|
+
"q+": Math.floor((date.getMonth() + 3) / 3),
|
|
43
|
+
"S+": date.getMilliseconds(),
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (/(y+)/i.test(format)) {
|
|
47
|
+
format = format.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length))
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
for (const k in time) {
|
|
51
|
+
if (new RegExp("(" + k + ")").test(format)) {
|
|
52
|
+
format = format.replace(
|
|
53
|
+
RegExp.$1,
|
|
54
|
+
RegExp.$1.length === 1 ? time[k] : ("00" + time[k]).substr(("" + time[k]).length),
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return format
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** 时间戳 转 指定的日期时间格式
|
|
62
|
+
* @param { String | Number } timestamp 时间戳
|
|
63
|
+
* @param { String } format 格式
|
|
64
|
+
* @return { String } 日期时间字符串
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* getTimestampDateTimeFormat('1484222693', 'yyyy-MM-dd') // 2017-01-12
|
|
68
|
+
*/
|
|
69
|
+
export function timestampFormat(timestamp, format) {
|
|
70
|
+
if (!timestamp) {
|
|
71
|
+
return timestamp
|
|
72
|
+
}
|
|
73
|
+
const date = timestampToDate(timestamp)
|
|
74
|
+
const result = dateFormat(date, format)
|
|
75
|
+
return result
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** 获取月份的天数
|
|
79
|
+
* @param { Date | String } date 时间对象
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* getDayInMonth() // 获取当前月份的天数
|
|
83
|
+
* getDayInMonth('2024-6') // 获取指定月份的天数
|
|
84
|
+
* getDayInMonth('2024-7') // 获取指定月份的天数
|
|
85
|
+
*/
|
|
86
|
+
export function getDayInMonth(now = new Date()) {
|
|
87
|
+
if (typeof now === "string") {
|
|
88
|
+
now = new Date(now)
|
|
89
|
+
}
|
|
90
|
+
return new Date(now.getFullYear(), now.getMonth() + 1, 0).getDate()
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** 日期加减
|
|
94
|
+
* @param { Date | String } date 时间对象
|
|
95
|
+
* @param { Object } _config 配置对象
|
|
96
|
+
* @param { 'add' | 'subtract' } _config.type 表示是加还是减
|
|
97
|
+
* @param { 'year' | 'month' } _config.field 要操作的年月,后续如果要支持日时分秒再补充
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* dateAddSubtract() // 默认当前月 加 1个月
|
|
101
|
+
* dateAddSubtract('2024-6') // 指定时间 加 1个月
|
|
102
|
+
* dateAddSubtract('2024-6', { field: 'year' }) // 指定时间 加 1年
|
|
103
|
+
* dateAddSubtract('2024-7') // 获取指定月份的天数
|
|
104
|
+
*
|
|
105
|
+
* dateAddSubtract('2024-6', { type: 'subtract' }) // 指定时间 减 1个月
|
|
106
|
+
* dateAddSubtract('2024-6', { type: 'subtract', field: 'year' }) // 指定时间 减 1年
|
|
107
|
+
*/
|
|
108
|
+
export function dateAddSubtract(now = new Date(), _config = {}) {
|
|
109
|
+
_config = {
|
|
110
|
+
type: "add",
|
|
111
|
+
field: "month",
|
|
112
|
+
..._config,
|
|
113
|
+
}
|
|
114
|
+
if (typeof now === "string") {
|
|
115
|
+
now = new Date(now)
|
|
116
|
+
}
|
|
117
|
+
let year = now.getFullYear()
|
|
118
|
+
let month = now.getMonth() // 注意:这里从0开始,0表示1月
|
|
119
|
+
if (_config.type === "add") {
|
|
120
|
+
if (_config.field === "year") {
|
|
121
|
+
year++
|
|
122
|
+
}
|
|
123
|
+
if (_config.field === "month") {
|
|
124
|
+
month++
|
|
125
|
+
// 如果月份超过11(即十二月之后),年份需要加1
|
|
126
|
+
if (month > 11) {
|
|
127
|
+
year++
|
|
128
|
+
month = 0 // 重置月份为0(即一月)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (_config.type === "subtract") {
|
|
133
|
+
if (_config.field === "year") {
|
|
134
|
+
year--
|
|
135
|
+
}
|
|
136
|
+
if (_config.field === "month") {
|
|
137
|
+
// 如果月份等于0(即1月),年份需要减1
|
|
138
|
+
if (month === 0) {
|
|
139
|
+
year--
|
|
140
|
+
month = 11 // 重置月份为11(即十二月)
|
|
141
|
+
} else {
|
|
142
|
+
month--
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return new Date(year, month, now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds())
|
|
148
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ljr-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"bin": {
|
|
7
8
|
"ljr": "lib/index.js",
|
|
8
|
-
"ljr-cli": "lib/index.js"
|
|
9
|
+
"ljr-cli": "lib/index.js",
|
|
10
|
+
"ljr-demo1": "lib/demo1.js",
|
|
11
|
+
"ljr-demo2": "lib/demo2.js"
|
|
9
12
|
},
|
|
10
13
|
"scripts": {
|
|
11
14
|
"发布": "npm publish"
|
|
@@ -14,6 +17,11 @@
|
|
|
14
17
|
"author": "",
|
|
15
18
|
"license": "ISC",
|
|
16
19
|
"dependencies": {
|
|
17
|
-
"
|
|
20
|
+
"@clack/prompts": "^0.11.0",
|
|
21
|
+
"commander": "^14.0.2",
|
|
22
|
+
"download-git-repo": "^3.0.2",
|
|
23
|
+
"fs-extra": "^11.3.3",
|
|
24
|
+
"gradient-string": "^3.0.0",
|
|
25
|
+
"replace-in-file": "^8.4.0"
|
|
18
26
|
}
|
|
19
27
|
}
|