Commit d196340d270d2becbf2cc81b7d4f09273381bd09

Authored by Vben
1 parent 4f20d45f

feat(demo): added guide page example

CHANGELOG.zh_CN.md
... ... @@ -10,6 +10,7 @@
10 10 - **CropperAvatar** 新增头像上传组件
11 11 - **Drawer** `useDrawer`新增`closeDrawer`函数
12 12 - **Preview** 新增`createImgPreview`图片预览函数
  13 +- **Setup** 新增引导页示例
13 14  
14 15 ### 🐛 Bug Fixes
15 16  
... ...
package.json
... ... @@ -32,7 +32,7 @@
32 32 "postinstall": "npm run install:husky"
33 33 },
34 34 "dependencies": {
35   - "@iconify/iconify": "^2.0.1",
  35 + "@iconify/iconify": "^2.0.2",
36 36 "@logicflow/core": "^0.4.14",
37 37 "@logicflow/extension": "^0.4.14",
38 38 "@vueuse/core": "^5.0.3",
... ... @@ -43,6 +43,7 @@
43 43 "cropperjs": "^1.5.12",
44 44 "crypto-js": "^4.0.0",
45 45 "echarts": "^5.1.2",
  46 + "intro.js": "^4.0.0",
46 47 "lodash-es": "^4.17.21",
47 48 "mockjs": "^1.1.0",
48 49 "nprogress": "^0.2.0",
... ... @@ -56,19 +57,20 @@
56 57 "vue": "3.0.11",
57 58 "vue-i18n": "9.1.6",
58 59 "vue-json-pretty": "^2.0.2",
59   - "vue-router": "^4.0.8",
  60 + "vue-router": "^4.0.9",
60 61 "vue-types": "^3.0.2",
61 62 "xlsx": "^0.17.0"
62 63 },
63 64 "devDependencies": {
64 65 "@commitlint/cli": "^12.1.4",
65 66 "@commitlint/config-conventional": "^12.1.4",
66   - "@iconify/json": "^1.1.356",
  67 + "@iconify/json": "^1.1.357",
67 68 "@purge-icons/generated": "^0.7.0",
68 69 "@types/codemirror": "^5.60.0",
69 70 "@types/crypto-js": "^4.0.1",
70 71 "@types/fs-extra": "^9.0.11",
71 72 "@types/inquirer": "^7.3.1",
  73 + "@types/intro.js": "^3.0.1",
72 74 "@types/lodash-es": "^4.17.4",
73 75 "@types/mockjs": "^1.0.3",
74 76 "@types/node": "^15.12.2",
... ... @@ -100,7 +102,7 @@
100 102 "is-ci": "^3.0.0",
101 103 "less": "^4.1.1",
102 104 "lint-staged": "^11.0.0",
103   - "postcss": "^8.3.4",
  105 + "postcss": "^8.3.5",
104 106 "prettier": "^2.3.1",
105 107 "pretty-quick": "^3.1.0",
106 108 "rimraf": "^3.0.2",
... ... @@ -110,7 +112,7 @@
110 112 "stylelint-config-standard": "^22.0.0",
111 113 "stylelint-order": "^4.1.0",
112 114 "ts-node": "^10.0.0",
113   - "typescript": "4.3.2",
  115 + "typescript": "4.3.3",
114 116 "vite": "2.3.7",
115 117 "vite-plugin-compression": "^0.2.5",
116 118 "vite-plugin-html": "^2.0.7",
... ... @@ -128,7 +130,7 @@
128 130 "resolutions": {
129 131 "//": "Used to install imagemin dependencies, because imagemin may not be installed in China. If it is abroad, you can delete it",
130 132 "bin-wrapper": "npm:bin-wrapper-china",
131   - "rollup": "^2.52.0"
  133 + "rollup": "^2.52.1"
132 134 },
133 135 "repository": {
134 136 "type": "git",
... ...
src/components/registerGlobComp.ts
  1 +import type { App } from 'vue';
1 2 import { Icon } from './Icon';
2 3 import { Button } from './Button';
3 4 import {
... ... @@ -6,8 +7,6 @@ import {
6 7 Input,
7 8 } from 'ant-design-vue';
8 9  
9   -import { App } from 'vue';
10   -
11 10 const compList = [Icon, AntButton.Group];
12 11  
13 12 export function registerGlobComp(app: App) {
... ...
src/locales/lang/en/routes/demo/setup.ts 0 → 100644
  1 +export default {
  2 + page: 'Intro page',
  3 +};
... ...
src/locales/lang/zh_CN/routes/demo/setup.ts 0 → 100644
  1 +export default {
  2 + page: '引导页',
  3 +};
... ...
src/router/menus/modules/demo/setup.ts 0 → 100644
  1 +import type { MenuModule } from '/@/router/types';
  2 +import { t } from '/@/hooks/web/useI18n';
  3 +
  4 +const setup: MenuModule = {
  5 + orderNo: 90000,
  6 + menu: {
  7 + path: '/setup/index',
  8 + name: t('routes.demo.setup.page'),
  9 + tag: {
  10 + content: 'new',
  11 + },
  12 + },
  13 +};
  14 +export default setup;
... ...
src/router/routes/modules/demo/setup.ts 0 → 100644
  1 +import type { AppRouteModule } from '/@/router/types';
  2 +
  3 +import { LAYOUT } from '/@/router/constant';
  4 +import { t } from '/@/hooks/web/useI18n';
  5 +
  6 +const setup: AppRouteModule = {
  7 + path: '/setup',
  8 + name: 'SetupDemo',
  9 + component: LAYOUT,
  10 + redirect: '/setup/index',
  11 + meta: {
  12 + icon: 'simple-icons:about-dot-me',
  13 + title: t('routes.demo.setup.page'),
  14 + },
  15 + children: [
  16 + {
  17 + path: 'index',
  18 + name: 'SetupDemoPage',
  19 + component: () => import('/@/views/demo/setup/index.vue'),
  20 + meta: {
  21 + title: t('routes.demo.setup.page'),
  22 + icon: 'whh:paintroll',
  23 + },
  24 + },
  25 + ],
  26 +};
  27 +
  28 +export default setup;
... ...
src/views/demo/setup/index.vue 0 → 100644
  1 +<template>
  2 + <PageWrapper title="引导页" content="用于给用于指引操作">
  3 + <a-button type="primary" @click="handleStart">开始</a-button>
  4 + </PageWrapper>
  5 +</template>
  6 +<script lang="ts">
  7 + import { defineComponent } from 'vue';
  8 + import { PageWrapper } from '/@/components/Page';
  9 + import { useDesign } from '/@/hooks/web/useDesign';
  10 + import intro from 'intro.js';
  11 + import 'intro.js/introjs.css';
  12 +
  13 + export default defineComponent({
  14 + components: { PageWrapper },
  15 + setup() {
  16 + const { prefixVar } = useDesign('');
  17 +
  18 + function handleStart() {
  19 + intro()
  20 + .setOptions({
  21 + steps: [
  22 + {
  23 + title: 'Welcome',
  24 + intro: 'Hello World! 👋',
  25 + },
  26 + {
  27 + title: 'Collapse Button',
  28 + element: document.querySelector(`.${prefixVar}-layout-header-trigger`)!,
  29 + intro: 'This is the menu collapse button.',
  30 + },
  31 + {
  32 + title: 'User Action',
  33 + element: document.querySelector(`.${prefixVar}-layout-header-action`)!,
  34 + intro: 'This is the user function area.',
  35 + },
  36 + ],
  37 + })
  38 + .start();
  39 + }
  40 + return { handleStart };
  41 + },
  42 + });
  43 +</script>
... ...
yarn.lock
... ... @@ -1184,17 +1184,17 @@
1184 1184 dependencies:
1185 1185 cross-fetch "^3.0.6"
1186 1186  
1187   -"@iconify/iconify@^2.0.1":
1188   - version "2.0.1"
1189   - resolved "https://registry.npmjs.org/@iconify/iconify/-/iconify-2.0.1.tgz#4927812922d50b378699694b5e72e22a1acc9d2f"
1190   - integrity sha512-heGCmdiRc58+TQjKPiem8cmNZj7YXDG3TphRVw0UGjsz8/OKgN2ncBPy1kfFIiv5aKhUsij6WVTfOMUS7YgTbA==
  1187 +"@iconify/iconify@^2.0.2":
  1188 + version "2.0.2"
  1189 + resolved "https://registry.npmjs.org/@iconify/iconify/-/iconify-2.0.2.tgz#8e8be6c8f20042ab69324bc6db6fc884be98b418"
  1190 + integrity sha512-m3MDKXYRRsrVLZFFUkSaTv9/jTk0sLOlIhlmupj2/VhHnZt0i3ACyUD7rx/Vd5bLvtotrHaT5e/ZOLP7uiFmKQ==
1191 1191 dependencies:
1192 1192 cross-fetch "^3.0.6"
1193 1193  
1194   -"@iconify/json@^1.1.356":
1195   - version "1.1.356"
1196   - resolved "https://registry.npmjs.org/@iconify/json/-/json-1.1.356.tgz#248b25843cf91618dff7ef4494a1b331efd1eb82"
1197   - integrity sha512-HeG9neoS5oatUTF6zlAAyDNPxbj0NvGDFqzd4wBtqu5mE4/xjhDO+S1obkgqpBrDedgoXDwIFkGx9Mx1HJCnaw==
  1194 +"@iconify/json@^1.1.357":
  1195 + version "1.1.357"
  1196 + resolved "https://registry.npmjs.org/@iconify/json/-/json-1.1.357.tgz#63dd3b358b80a3774e24ce0a136488b819a20dbd"
  1197 + integrity sha512-X4tXnyCKCAKRopGtvQjp3LmPX3TaUUfi2DwD41SQItBp9PbsZXg9+tYJbWjl0+gFFv7ikdzAp+yGIaXuZT/k5g==
1198 1198  
1199 1199 "@intlify/core-base@9.1.6":
1200 1200 version "9.1.6"
... ... @@ -1646,6 +1646,11 @@
1646 1646 "@types/through" "*"
1647 1647 rxjs "^6.4.0"
1648 1648  
  1649 +"@types/intro.js@^3.0.1":
  1650 + version "3.0.1"
  1651 + resolved "https://registry.npmjs.org/@types/intro.js/-/intro.js-3.0.1.tgz#2a5272d6ceb715676f496fd0060eedc70d98c6fe"
  1652 + integrity sha512-L4vCKY/4ZFpRgILDHd3oacARWYKYpz3oJfjweoc0ooM+OoM1HEtGRFM0JuNYQNTrgUXe+R4rUyLDYSeSnrmdLw==
  1653 +
1649 1654 "@types/json-schema@^7.0.7":
1650 1655 version "7.0.7"
1651 1656 resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
... ... @@ -2006,10 +2011,10 @@
2006 2011 "@vue/compiler-dom" "3.0.11"
2007 2012 "@vue/shared" "3.0.11"
2008 2013  
2009   -"@vue/devtools-api@^6.0.0-beta.10":
2010   - version "6.0.0-beta.10"
2011   - resolved "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.0.0-beta.10.tgz#f39da7618cee292e39c7274227c34163e30eb3ca"
2012   - integrity sha512-nktQYRnIFrh4DdXiCBjHnsHOMZXDIVcP9qlm/DMfxmjJMtpMGrSZCOKP8j7kDhObNHyqlicwoGLd+a4hf4x9ww==
  2014 +"@vue/devtools-api@^6.0.0-beta.14":
  2015 + version "6.0.0-beta.14"
  2016 + resolved "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.0.0-beta.14.tgz#6ed2d6f8d66a9256c9ad04bfff08309ba87b9723"
  2017 + integrity sha512-44fPrrN1cqcs6bFkT0C+yxTM6PZXLbR+ESh1U1j8UD22yO04gXvxH62HApMjLbS3WqJO/iCNC+CYT+evPQh2EQ==
2013 2018  
2014 2019 "@vue/devtools-api@^6.0.0-beta.7":
2015 2020 version "6.0.0-beta.11"
... ... @@ -5863,6 +5868,11 @@ into-stream@^3.1.0:
5863 5868 from2 "^2.1.1"
5864 5869 p-is-promise "^1.1.0"
5865 5870  
  5871 +intro.js@^4.0.0:
  5872 + version "4.0.0"
  5873 + resolved "https://registry.npmjs.org/intro.js/-/intro.js-4.0.0.tgz#6897f0dc6bb9997f73613ae3c7cd26e16b05a5eb"
  5874 + integrity sha512-IS8+p4rpnWUq2Vd8YRgjR8w9lbyLvT0ptscBqA4iudO68oven39CvxHfxopfwlNUGgmgcyX17DOETof+D90AXA==
  5875 +
5866 5876 is-accessor-descriptor@^0.1.6:
5867 5877 version "0.1.6"
5868 5878 resolved "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
... ... @@ -8143,10 +8153,10 @@ postcss@^8.3.0:
8143 8153 nanoid "^3.1.23"
8144 8154 source-map-js "^0.6.2"
8145 8155  
8146   -postcss@^8.3.4:
8147   - version "8.3.4"
8148   - resolved "https://registry.npmjs.org/postcss/-/postcss-8.3.4.tgz#41ece1c43f2f7c74dc7d90144047ce052757b822"
8149   - integrity sha512-/tZY0PXExXXnNhKv3TOvZAOUYRyuqcCbBm2c17YMDK0PlVII3K7/LKdt3ScHL+hhouddjUWi+1sKDf9xXW+8YA==
  8156 +postcss@^8.3.5:
  8157 + version "8.3.5"
  8158 + resolved "https://registry.npmjs.org/postcss/-/postcss-8.3.5.tgz#982216b113412bc20a86289e91eb994952a5b709"
  8159 + integrity sha512-NxTuJocUhYGsMiMFHDUkmjSKT3EdH4/WbGF6GCi1NDGk+vbcUTun4fpbOqaPtD8IIsztA2ilZm2DhYCuyN58gA==
8150 8160 dependencies:
8151 8161 colorette "^1.2.2"
8152 8162 nanoid "^3.1.23"
... ... @@ -8878,10 +8888,10 @@ rollup-plugin-visualizer@5.5.0:
8878 8888 source-map "^0.7.3"
8879 8889 yargs "^16.2.0"
8880 8890  
8881   -rollup@^2.38.5, rollup@^2.43.1, rollup@^2.51.2, rollup@^2.52.0:
8882   - version "2.52.0"
8883   - resolved "https://registry.npmjs.org/rollup/-/rollup-2.52.0.tgz#9df3de6028fae79569a985942b81110205a5a411"
8884   - integrity sha512-lSkBDGsVoXjqaBf7dsHwxBJz+p+hJEP72P+LOitA0yVs+Nzxj76FidkZE2thrmhjwGqLYiJo39opi7mAfaQ/Vg==
  8891 +rollup@^2.38.5, rollup@^2.43.1, rollup@^2.51.2, rollup@^2.52.1:
  8892 + version "2.52.1"
  8893 + resolved "https://registry.npmjs.org/rollup/-/rollup-2.52.1.tgz#dd1cc178d70cf35c48d943fc06fdc32d546e6876"
  8894 + integrity sha512-/SPqz8UGnp4P1hq6wc9gdTqA2bXQXGx13TtoL03GBm6qGRI6Hm3p4Io7GeiHNLl0BsQAne1JNYY+q/apcY933w==
8885 8895 optionalDependencies:
8886 8896 fsevents "~2.3.2"
8887 8897  
... ... @@ -10079,10 +10089,10 @@ typescript-vscode-sh-plugin@^0.6.14:
10079 10089 resolved "https://registry.npmjs.org/typescript-vscode-sh-plugin/-/typescript-vscode-sh-plugin-0.6.14.tgz#a81031b502f6346a26ea49ce082438c3e353bb38"
10080 10090 integrity sha512-AkNlRBbI6K7gk29O92qthNSvc6jjmNQ6isVXoYxkFwPa8D04tIv2SOPd+sd+mNpso4tNdL2gy7nVtrd5yFqvlA==
10081 10091  
10082   -typescript@4.3.2:
10083   - version "4.3.2"
10084   - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805"
10085   - integrity sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==
  10092 +typescript@4.3.3:
  10093 + version "4.3.3"
  10094 + resolved "https://registry.npmjs.org/typescript/-/typescript-4.3.3.tgz#5401db69bd3203daf1851a1a74d199cb3112c11a"
  10095 + integrity sha512-rUvLW0WtF7PF2b9yenwWUi9Da9euvDRhmH7BLyBG4DCFfOJ850LGNknmRpp8Z8kXNUPObdZQEfKOiHtXuQHHKA==
10086 10096  
10087 10097 uglify-js@^3.1.4:
10088 10098 version "3.13.3"
... ... @@ -10859,12 +10869,12 @@ vue-json-pretty@^2.0.2:
10859 10869 resolved "https://registry.npmjs.com/vue-json-pretty/-/vue-json-pretty-2.0.2.tgz#cb8f559af15ea3a2ee53b2742672c7791826d6a3"
10860 10870 integrity sha512-Vn7SX3XR9cfvGRNoTDNID89GmvVUMb7/fLUX3C3n0Qptga0N7hp7Zwspui1I1XN5pE+PeoVghCSYty+bi8KnjA==
10861 10871  
10862   -vue-router@^4.0.8:
10863   - version "4.0.8"
10864   - resolved "https://registry.npmjs.org/vue-router/-/vue-router-4.0.8.tgz#55d4290a3122444edbc91a3cd2492bb1d0cef494"
10865   - integrity sha512-42mWSQaH7CCBQDspQTHv63f34VEnZC20g9QNK4WJ/zW8SdIUeT6TQ2i/78fjF/pVBUPLBWrGhvB7uDnaz7O/pA==
  10872 +vue-router@^4.0.9:
  10873 + version "4.0.9"
  10874 + resolved "https://registry.npmjs.org/vue-router/-/vue-router-4.0.9.tgz#248496941b79c4c1010f6ebfcf235cd4267d85da"
  10875 + integrity sha512-i3IaZJ57YeMbRHQlqKyXdUMr5NzTCcJkn3f8u38TsZjYWtGcd3IX2zRd3389SCOwuRf11mgfHAyngR6FVDE9og==
10866 10876 dependencies:
10867   - "@vue/devtools-api" "^6.0.0-beta.10"
  10877 + "@vue/devtools-api" "^6.0.0-beta.14"
10868 10878  
10869 10879 vue-tsc@^0.1.7:
10870 10880 version "0.1.7"
... ...