fix(projects): 修复页面滚动行为

This commit is contained in:
Soybean 2021-09-14 19:10:10 +08:00
parent ab77d58e46
commit 57e00e6417
12 changed files with 189 additions and 113 deletions

View File

@ -23,7 +23,7 @@
"chroma-js": "^2.1.2",
"dayjs": "^1.10.7",
"form-data": "^4.0.0",
"naive-ui": "^2.18.1",
"naive-ui": "^2.18.2",
"pinia": "^2.0.0-rc.4",
"qs": "^6.10.1",
"smoothscroll-polyfill": "^0.4.4",
@ -60,13 +60,13 @@
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.4.0",
"sass": "^1.39.2",
"sass": "^1.40.0",
"typescript": "^4.4.3",
"unplugin-icons": "^0.9.0",
"unplugin-vue-components": "^0.15.0",
"unplugin-icons": "^0.10.0",
"unplugin-vue-components": "^0.15.1",
"vite": "^2.5.7",
"vite-plugin-html": "^2.1.0",
"vite-plugin-windicss": "^1.4.2",
"vite-plugin-windicss": "^1.4.3",
"vue-tsc": "^0.3.0",
"windicss": "^3.1.7"
},

View File

@ -32,20 +32,20 @@ specifiers:
form-data: ^4.0.0
husky: ^7.0.2
lint-staged: ^11.1.2
naive-ui: ^2.18.1
naive-ui: ^2.18.2
patch-package: ^6.4.7
pinia: ^2.0.0-rc.4
postinstall-postinstall: ^2.1.0
prettier: ^2.4.0
qs: ^6.10.1
sass: ^1.39.2
sass: ^1.40.0
smoothscroll-polyfill: ^0.4.4
typescript: ^4.4.3
unplugin-icons: ^0.9.0
unplugin-vue-components: ^0.15.0
unplugin-icons: ^0.10.0
unplugin-vue-components: ^0.15.1
vite: ^2.5.7
vite-plugin-html: ^2.1.0
vite-plugin-windicss: ^1.4.2
vite-plugin-windicss: ^1.4.3
vue: ^3.2.10
vue-router: ^4.0.11
vue-tsc: ^0.3.0
@ -57,7 +57,7 @@ dependencies:
chroma-js: registry.nlark.com/chroma-js/2.1.2
dayjs: registry.nlark.com/dayjs/1.10.7
form-data: 4.0.0
naive-ui: registry.nlark.com/naive-ui/2.18.1_vue@3.2.10
naive-ui: registry.nlark.com/naive-ui/2.18.2_vue@3.2.10
pinia: registry.nlark.com/pinia/2.0.0-rc.4_typescript@4.4.3+vue@3.2.10
qs: 6.10.1
smoothscroll-polyfill: registry.nlark.com/smoothscroll-polyfill/0.4.4
@ -94,13 +94,13 @@ devDependencies:
patch-package: registry.nlark.com/patch-package/6.4.7
postinstall-postinstall: registry.nlark.com/postinstall-postinstall/2.1.0
prettier: registry.nlark.com/prettier/2.4.0
sass: registry.nlark.com/sass/1.39.2
sass: registry.nlark.com/sass/1.40.0
typescript: registry.nlark.com/typescript/4.4.3
unplugin-icons: registry.nlark.com/unplugin-icons/0.9.0_54da2e3458e54be8937824c348b2c77e
unplugin-vue-components: registry.nlark.com/unplugin-vue-components/0.15.0_vite@2.5.7+vue@3.2.10
unplugin-icons: registry.nlark.com/unplugin-icons/0.10.0_54da2e3458e54be8937824c348b2c77e
unplugin-vue-components: registry.nlark.com/unplugin-vue-components/0.15.1_vite@2.5.7+vue@3.2.10
vite: registry.nlark.com/vite/2.5.7
vite-plugin-html: registry.nlark.com/vite-plugin-html/2.1.0_vite@2.5.7
vite-plugin-windicss: registry.nlark.com/vite-plugin-windicss/1.4.2_typescript@4.4.3+vite@2.5.7
vite-plugin-windicss: registry.nlark.com/vite-plugin-windicss/1.4.3_typescript@4.4.3+vite@2.5.7
vue-tsc: registry.nlark.com/vue-tsc/0.3.0_typescript@4.4.3
windicss: registry.nlark.com/windicss/3.1.7
@ -141,6 +141,8 @@ packages:
eslint: registry.nlark.com/eslint/7.32.0
eslint-plugin-vue: registry.nlark.com/eslint-plugin-vue/7.17.0_eslint@7.32.0
vue-eslint-parser: registry.nlark.com/vue-eslint-parser/7.10.0_eslint@7.32.0
transitivePeerDependencies:
- supports-color
dev: true
/@yarnpkg/lockfile/1.1.0:
@ -1162,7 +1164,7 @@ packages:
dev: true
/merge2/1.4.1:
resolution: {integrity: sha1-Q2iJL4hekHRVpv19xVwMnUBJkK4=, tarball: https://registry.npm.taobao.org/merge2/download/merge2-1.4.1.tgz}
resolution: {integrity: sha1-Q2iJL4hekHRVpv19xVwMnUBJkK4=, tarball: merge2/download/merge2-1.4.1.tgz}
engines: {node: '>= 8'}
dev: true
@ -1609,7 +1611,7 @@ packages:
dev: true
/resolve/1.20.0:
resolution: {integrity: sha1-YpoBP7P3B1XW8LeTXMHCxTeLGXU=, tarball: https://registry.npm.taobao.org/resolve/download/resolve-1.20.0.tgz}
resolution: {integrity: sha1-YpoBP7P3B1XW8LeTXMHCxTeLGXU=, tarball: resolve/download/resolve-1.20.0.tgz}
dependencies:
is-core-module: registry.nlark.com/is-core-module/2.6.0
path-parse: registry.nlark.com/path-parse/1.0.7
@ -1892,7 +1894,7 @@ packages:
dev: true
/tsutils/3.21.0_typescript@4.4.3:
resolution: {integrity: sha1-tIcX05TOpsHglpg+7Vjp1hcVtiM=, tarball: https://registry.npm.taobao.org/tsutils/download/tsutils-3.21.0.tgz?cache=0&sync_timestamp=1615138184534&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftsutils%2Fdownload%2Ftsutils-3.21.0.tgz}
resolution: {integrity: sha1-tIcX05TOpsHglpg+7Vjp1hcVtiM=, tarball: tsutils/download/tsutils-3.21.0.tgz?cache=0&sync_timestamp=1615138184534&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftsutils%2Fdownload%2Ftsutils-3.21.0.tgz}
engines: {node: '>= 6'}
peerDependencies:
typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
@ -1921,7 +1923,7 @@ packages:
dev: true
/upath/2.0.1:
resolution: {integrity: sha1-UMc96mjW9rmQ9R0nnOYIFmXWGos=, tarball: https://registry.npm.taobao.org/upath/download/upath-2.0.1.tgz}
resolution: {integrity: sha1-UMc96mjW9rmQ9R0nnOYIFmXWGos=, tarball: upath/download/upath-2.0.1.tgz}
engines: {node: '>=4'}
dev: true
@ -2333,7 +2335,7 @@ packages:
dev: true
registry.nlark.com/@iconify/json-tools/1.0.10:
resolution: {integrity: sha1-2acFDbvouynWhNSz+URu0tC+o8w=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@iconify/json-tools/download/@iconify/json-tools-1.0.10.tgz}
resolution: {integrity: sha1-2acFDbvouynWhNSz+URu0tC+o8w=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@iconify/json-tools/download/@iconify/json-tools-1.0.10.tgz}
name: '@iconify/json-tools'
version: 1.0.10
dev: true
@ -2356,7 +2358,7 @@ packages:
dev: true
registry.nlark.com/@jest/types/26.6.2:
resolution: {integrity: sha1-vvWlMgMOHYii9abZM/hOlyJu1I4=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@jest/types/download/@jest/types-26.6.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40jest%2Ftypes%2Fdownload%2F%40jest%2Ftypes-26.6.2.tgz}
resolution: {integrity: sha1-vvWlMgMOHYii9abZM/hOlyJu1I4=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@jest/types/download/@jest/types-26.6.2.tgz?cache=0&sync_timestamp=1631096097351&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40jest%2Ftypes%2Fdownload%2F%40jest%2Ftypes-26.6.2.tgz}
name: '@jest/types'
version: 26.6.2
engines: {node: '>= 10.14.2'}
@ -2475,19 +2477,19 @@ packages:
dev: true
registry.nlark.com/@types/node/14.14.45:
resolution: {integrity: sha1-7C37VWb/gU0GGu9+FBV1rtuiRc8=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@types/node/download/@types/node-14.14.45.tgz?cache=0&sync_timestamp=1631000782845&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.14.45.tgz}
resolution: {integrity: sha1-7C37VWb/gU0GGu9+FBV1rtuiRc8=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@types/node/download/@types/node-14.14.45.tgz?cache=0&sync_timestamp=1631217901150&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.14.45.tgz}
name: '@types/node'
version: 14.14.45
dev: false
registry.nlark.com/@types/node/14.17.10:
resolution: {integrity: sha1-k/Swla8nWgQnEUV5wQ7HqmlnKdc=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@types/node/download/@types/node-14.17.10.tgz?cache=0&sync_timestamp=1631000782845&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.17.10.tgz}
resolution: {integrity: sha1-k/Swla8nWgQnEUV5wQ7HqmlnKdc=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@types/node/download/@types/node-14.17.10.tgz?cache=0&sync_timestamp=1631217901150&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.17.10.tgz}
name: '@types/node'
version: 14.17.10
dev: false
registry.nlark.com/@types/node/16.6.2:
resolution: {integrity: sha1-Mxt7n4YhxjgoR4fFVZQjgi/f/FA=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@types/node/download/@types/node-16.6.2.tgz?cache=0&sync_timestamp=1631000782845&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-16.6.2.tgz}
resolution: {integrity: sha1-Mxt7n4YhxjgoR4fFVZQjgi/f/FA=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@types/node/download/@types/node-16.6.2.tgz?cache=0&sync_timestamp=1631217901150&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-16.6.2.tgz}
name: '@types/node'
version: 16.6.2
dev: false
@ -2551,6 +2553,10 @@ packages:
peerDependencies:
'@typescript-eslint/parser': ^4.0.0
eslint: ^5.0.0 || ^6.0.0 || ^7.0.0
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/experimental-utils': registry.nlark.com/@typescript-eslint/experimental-utils/4.31.1_eslint@7.32.0+typescript@4.4.3
'@typescript-eslint/parser': registry.nlark.com/@typescript-eslint/parser/4.31.1_eslint@7.32.0+typescript@4.4.3
@ -2561,8 +2567,9 @@ packages:
regexpp: registry.nlark.com/regexpp/3.2.0
semver: registry.nlark.com/semver/7.3.5
tsutils: 3.21.0_typescript@4.4.3
typescript: registry.nlark.com/typescript/4.4.3
transitivePeerDependencies:
- typescript
- supports-color
dev: true
registry.nlark.com/@typescript-eslint/experimental-utils/4.31.1_eslint@7.32.0+typescript@4.4.3:
@ -2582,6 +2589,7 @@ packages:
eslint-scope: registry.nlark.com/eslint-scope/5.1.1
eslint-utils: registry.nlark.com/eslint-utils/3.0.0_eslint@7.32.0
transitivePeerDependencies:
- supports-color
- typescript
dev: true
@ -2593,14 +2601,19 @@ packages:
engines: {node: ^10.12.0 || >=12.0.0}
peerDependencies:
eslint: ^5.0.0 || ^6.0.0 || ^7.0.0
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/scope-manager': registry.nlark.com/@typescript-eslint/scope-manager/4.31.1
'@typescript-eslint/types': registry.nlark.com/@typescript-eslint/types/4.31.1
'@typescript-eslint/typescript-estree': registry.nlark.com/@typescript-eslint/typescript-estree/4.31.1_typescript@4.4.3
debug: registry.nlark.com/debug/4.3.2
eslint: registry.nlark.com/eslint/7.32.0
typescript: registry.nlark.com/typescript/4.4.3
transitivePeerDependencies:
- typescript
- supports-color
dev: true
registry.nlark.com/@typescript-eslint/scope-manager/4.31.1:
@ -2626,6 +2639,11 @@ packages:
name: '@typescript-eslint/typescript-estree'
version: 4.31.1
engines: {node: ^10.12.0 || >=12.0.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/types': registry.nlark.com/@typescript-eslint/types/4.31.1
'@typescript-eslint/visitor-keys': registry.nlark.com/@typescript-eslint/visitor-keys/4.31.1
@ -2634,8 +2652,9 @@ packages:
is-glob: registry.nlark.com/is-glob/4.0.1
semver: registry.nlark.com/semver/7.3.5
tsutils: 3.21.0_typescript@4.4.3
typescript: registry.nlark.com/typescript/4.4.3
transitivePeerDependencies:
- typescript
- supports-color
dev: true
registry.nlark.com/@typescript-eslint/visitor-keys/4.31.1:
@ -2928,6 +2947,11 @@ packages:
peerDependencies:
'@vue/composition-api': ^1.1.0
vue: ^2.6.0 || ^3.2.0
peerDependenciesMeta:
'@vue/composition-api':
optional: true
vue:
optional: true
dependencies:
'@vueuse/shared': registry.nlark.com/@vueuse/shared/6.3.3_vue@3.2.10
vue: registry.nlark.com/vue/3.2.10
@ -2942,40 +2966,47 @@ packages:
peerDependencies:
'@vue/composition-api': ^1.1.0
vue: ^2.6.0 || ^3.2.0
peerDependenciesMeta:
'@vue/composition-api':
optional: true
vue:
optional: true
dependencies:
vue: registry.nlark.com/vue/3.2.10
vue-demi: registry.nlark.com/vue-demi/0.11.4_vue@3.2.10
dev: false
registry.nlark.com/@windicss/config/1.4.2_typescript@4.4.3:
resolution: {integrity: sha1-PYbV4uJMwgraUDAZCo3GU9syTzU=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@windicss/config/download/@windicss/config-1.4.2.tgz}
id: registry.nlark.com/@windicss/config/1.4.2
registry.nlark.com/@windicss/config/1.4.3_typescript@4.4.3:
resolution: {integrity: sha1-wy/gxTBdS8Mn9MpkXVQ9aJDZu5A=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@windicss/config/download/@windicss/config-1.4.3.tgz}
id: registry.nlark.com/@windicss/config/1.4.3
name: '@windicss/config'
version: 1.4.2
version: 1.4.3
dependencies:
debug: registry.nlark.com/debug/4.3.2
jiti: registry.nlark.com/jiti/1.11.0
jiti: registry.nlark.com/jiti/1.12.0
tsup: registry.nlark.com/tsup/4.14.0_typescript@4.4.3
windicss: registry.nlark.com/windicss/3.1.7
transitivePeerDependencies:
- supports-color
- ts-node
- typescript
dev: true
registry.nlark.com/@windicss/plugin-utils/1.4.2_typescript@4.4.3:
resolution: {integrity: sha1-ElutjP5YeUFQbmaC9g+RD1Z/brM=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@windicss/plugin-utils/download/@windicss/plugin-utils-1.4.2.tgz}
id: registry.nlark.com/@windicss/plugin-utils/1.4.2
registry.nlark.com/@windicss/plugin-utils/1.4.3_typescript@4.4.3:
resolution: {integrity: sha1-MDFWtOYVp1huY1JgWv+QT8OKsY8=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/@windicss/plugin-utils/download/@windicss/plugin-utils-1.4.3.tgz}
id: registry.nlark.com/@windicss/plugin-utils/1.4.3
name: '@windicss/plugin-utils'
version: 1.4.2
version: 1.4.3
dependencies:
'@antfu/utils': registry.nlark.com/@antfu/utils/0.2.4
'@windicss/config': registry.nlark.com/@windicss/config/1.4.2_typescript@4.4.3
'@windicss/config': registry.nlark.com/@windicss/config/1.4.3_typescript@4.4.3
debug: registry.nlark.com/debug/4.3.2
fast-glob: registry.nlark.com/fast-glob/3.2.7
magic-string: registry.nlark.com/magic-string/0.25.7
micromatch: 4.0.4
windicss: registry.nlark.com/windicss/3.1.7
transitivePeerDependencies:
- supports-color
- ts-node
- typescript
dev: true
@ -3022,7 +3053,7 @@ packages:
dev: true
registry.nlark.com/ansi-regex/5.0.0:
resolution: {integrity: sha1-OIU59VF5vzkznIGvMKZU1p+Hy3U=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/ansi-regex/download/ansi-regex-5.0.0.tgz}
resolution: {integrity: sha1-OIU59VF5vzkznIGvMKZU1p+Hy3U=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/ansi-regex/download/ansi-regex-5.0.0.tgz?cache=0&sync_timestamp=1631305520732&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fansi-regex%2Fdownload%2Fansi-regex-5.0.0.tgz}
name: ansi-regex
version: 5.0.0
engines: {node: '>=8'}
@ -3271,7 +3302,7 @@ packages:
dev: true
registry.nlark.com/commander/4.1.1:
resolution: {integrity: sha1-n9YCvZNilOnp70aj9NaWQESxgGg=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/commander/download/commander-4.1.1.tgz?cache=0&sync_timestamp=1627358203890&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcommander%2Fdownload%2Fcommander-4.1.1.tgz}
resolution: {integrity: sha1-n9YCvZNilOnp70aj9NaWQESxgGg=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/commander/download/commander-4.1.1.tgz}
name: commander
version: 4.1.1
engines: {node: '>= 6'}
@ -3418,6 +3449,17 @@ packages:
engines: {node: '>=8'}
dev: true
registry.nlark.com/date-fns-tz/1.1.6_date-fns@2.23.0:
resolution: {integrity: sha1-k8vzVOKuss0xL/oy5GLBlDzyCo4=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/date-fns-tz/download/date-fns-tz-1.1.6.tgz}
id: registry.nlark.com/date-fns-tz/1.1.6
name: date-fns-tz
version: 1.1.6
peerDependencies:
date-fns: '>=2.0.0-alpha.13'
dependencies:
date-fns: registry.nlark.com/date-fns/2.23.0
dev: false
registry.nlark.com/date-fns/2.23.0:
resolution: {integrity: sha1-TohslBZZrwz3sw+v3R6qN+iHiKk=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/date-fns/download/date-fns-2.23.0.tgz?cache=0&sync_timestamp=1627020299263&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdate-fns%2Fdownload%2Fdate-fns-2.23.0.tgz}
name: date-fns
@ -3452,6 +3494,11 @@ packages:
name: debug
version: 4.3.2
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
dependencies:
ms: registry.nlark.com/ms/2.1.2
dev: true
@ -3570,7 +3617,7 @@ packages:
dev: true
registry.nlark.com/esbuild/0.12.21:
resolution: {integrity: sha1-f/Mqmsc85DEPnLYepMPal1ZXDUY=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/esbuild/download/esbuild-0.12.21.tgz?cache=0&sync_timestamp=1631497076947&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fesbuild%2Fdownload%2Fesbuild-0.12.21.tgz}
resolution: {integrity: sha1-f/Mqmsc85DEPnLYepMPal1ZXDUY=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/esbuild/download/esbuild-0.12.21.tgz?cache=0&sync_timestamp=1631587318573&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fesbuild%2Fdownload%2Fesbuild-0.12.21.tgz}
name: esbuild
version: 0.12.21
hasBin: true
@ -3682,6 +3729,8 @@ packages:
natural-compare: 1.4.0
semver: 6.3.0
vue-eslint-parser: registry.nlark.com/vue-eslint-parser/7.10.0_eslint@7.32.0
transitivePeerDependencies:
- supports-color
dev: true
registry.nlark.com/eslint-scope/5.1.1:
@ -3961,7 +4010,7 @@ packages:
dev: true
registry.nlark.com/fsevents/2.3.2:
resolution: {integrity: sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/fsevents/download/fsevents-2.3.2.tgz}
resolution: {integrity: sha1-ilJveLj99GI7cJ4Ll1xSwkwC/Ro=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/fsevents/download/fsevents-2.3.2.tgz}
name: fsevents
version: 2.3.2
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
@ -3976,12 +4025,12 @@ packages:
dev: true
registry.nlark.com/glob-parent/5.1.2:
resolution: {integrity: sha1-hpgyxYA0/mikCTwX3BXoNA2EAcQ=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/glob-parent/download/glob-parent-5.1.2.tgz}
resolution: {integrity: sha1-hpgyxYA0/mikCTwX3BXoNA2EAcQ=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/glob-parent/download/glob-parent-5.1.2.tgz?cache=0&sync_timestamp=1626760165717&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fglob-parent%2Fdownload%2Fglob-parent-5.1.2.tgz}
name: glob-parent
version: 5.1.2
engines: {node: '>= 6'}
dependencies:
is-glob: 4.0.1
is-glob: registry.nlark.com/is-glob/4.0.1
dev: true
registry.nlark.com/glob/7.1.4:
@ -3998,7 +4047,7 @@ packages:
dev: true
registry.nlark.com/glob/7.1.6:
resolution: {integrity: sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/glob/download/glob-7.1.6.tgz}
resolution: {integrity: sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/glob/download/glob-7.1.6.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fglob%2Fdownload%2Fglob-7.1.6.tgz}
name: glob
version: 7.1.6
dependencies:
@ -4066,7 +4115,7 @@ packages:
engines: {node: '>=8'}
registry.nlark.com/has-pkg/0.0.1:
resolution: {integrity: sha1-+dkTntg+JIferl60rBMYKi6QOFc=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/has-pkg/download/has-pkg-0.0.1.tgz}
resolution: {integrity: sha1-+dkTntg+JIferl60rBMYKi6QOFc=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/has-pkg/download/has-pkg-0.0.1.tgz}
name: has-pkg
version: 0.0.1
dev: true
@ -4143,7 +4192,7 @@ packages:
dev: true
registry.nlark.com/import-cwd/3.0.0:
resolution: {integrity: sha1-IIRVR3GAFRJuqbNna3WS+4vUz5I=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/import-cwd/download/import-cwd-3.0.0.tgz?cache=0&sync_timestamp=1618846826220&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fimport-cwd%2Fdownload%2Fimport-cwd-3.0.0.tgz}
resolution: {integrity: sha1-IIRVR3GAFRJuqbNna3WS+4vUz5I=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/import-cwd/download/import-cwd-3.0.0.tgz}
name: import-cwd
version: 3.0.0
engines: {node: '>=8'}
@ -4343,7 +4392,7 @@ packages:
dev: true
registry.nlark.com/jest-diff/26.6.2:
resolution: {integrity: sha1-GqdGi1LDpo19XF/c381eSb0WQ5Q=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/jest-diff/download/jest-diff-26.6.2.tgz}
resolution: {integrity: sha1-GqdGi1LDpo19XF/c381eSb0WQ5Q=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/jest-diff/download/jest-diff-26.6.2.tgz?cache=0&sync_timestamp=1631520428777&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjest-diff%2Fdownload%2Fjest-diff-26.6.2.tgz}
name: jest-diff
version: 26.6.2
engines: {node: '>= 10.14.2'}
@ -4361,10 +4410,10 @@ packages:
engines: {node: '>= 10.14.2'}
dev: false
registry.nlark.com/jiti/1.11.0:
resolution: {integrity: sha1-ZBIKMNl7m/N7iwMs9FZN+twomEw=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/jiti/download/jiti-1.11.0.tgz}
registry.nlark.com/jiti/1.12.0:
resolution: {integrity: sha1-b24ZCPlCUHViZABpLwttkC2yYuQ=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/jiti/download/jiti-1.12.0.tgz?cache=0&sync_timestamp=1631530402093&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fjiti%2Fdownload%2Fjiti-1.12.0.tgz}
name: jiti
version: 1.11.0
version: 1.12.0
hasBin: true
dev: true
@ -4433,6 +4482,8 @@ packages:
please-upgrade-node: 3.2.0
string-argv: 0.3.1
stringify-object: 3.3.0
transitivePeerDependencies:
- supports-color
dev: true
registry.nlark.com/listr2/3.11.0_enquirer@2.3.6:
@ -4606,11 +4657,11 @@ packages:
version: 2.1.3
dev: true
registry.nlark.com/naive-ui/2.18.1_vue@3.2.10:
resolution: {integrity: sha1-9vILaIHUclxKfPaqdcBwj6eH028=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/naive-ui/download/naive-ui-2.18.1.tgz}
id: registry.nlark.com/naive-ui/2.18.1
registry.nlark.com/naive-ui/2.18.2_vue@3.2.10:
resolution: {integrity: sha1-gpM7tR69RPQzB17ne847efqrYTk=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/naive-ui/download/naive-ui-2.18.2.tgz}
id: registry.nlark.com/naive-ui/2.18.2
name: naive-ui
version: 2.18.1
version: 2.18.2
peerDependencies:
vue: ^3.0.0
dependencies:
@ -4621,6 +4672,7 @@ packages:
async-validator: registry.nlark.com/async-validator/4.0.2
css-render: registry.nlark.com/css-render/0.15.6
date-fns: registry.nlark.com/date-fns/2.23.0
date-fns-tz: registry.nlark.com/date-fns-tz/1.1.6_date-fns@2.23.0
evtd: registry.nlark.com/evtd/0.2.2
highlight.js: registry.nlark.com/highlight.js/11.2.0
lodash: registry.nlark.com/lodash/4.17.21
@ -4820,7 +4872,7 @@ packages:
dev: true
registry.nlark.com/path-parse/1.0.7:
resolution: {integrity: sha1-+8EUtgykKzDZ2vWFjkvWi77bZzU=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/path-parse/download/path-parse-1.0.7.tgz}
resolution: {integrity: sha1-+8EUtgykKzDZ2vWFjkvWi77bZzU=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/path-parse/download/path-parse-1.0.7.tgz}
name: path-parse
version: 1.0.7
dev: true
@ -4885,9 +4937,6 @@ packages:
engines: {node: '>= 10'}
peerDependencies:
ts-node: '>=9.0.0'
peerDependenciesMeta:
ts-node:
optional: true
dependencies:
import-cwd: registry.nlark.com/import-cwd/3.0.0
lilconfig: registry.nlark.com/lilconfig/2.0.3
@ -5009,7 +5058,7 @@ packages:
dev: true
registry.nlark.com/pretty-format/26.6.2:
resolution: {integrity: sha1-41wnBfFMt/4v6U+geDRbREEg/JM=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/pretty-format/download/pretty-format-26.6.2.tgz}
resolution: {integrity: sha1-41wnBfFMt/4v6U+geDRbREEg/JM=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/pretty-format/download/pretty-format-26.6.2.tgz?cache=0&sync_timestamp=1631520426763&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fpretty-format%2Fdownload%2Fpretty-format-26.6.2.tgz}
name: pretty-format
version: 26.6.2
engines: {node: '>= 10'}
@ -5034,7 +5083,7 @@ packages:
dev: true
registry.nlark.com/react-is/17.0.2:
resolution: {integrity: sha1-5pHUqOnHiTZWVVOas3J2Kw77VPA=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/react-is/download/react-is-17.0.2.tgz?cache=0&sync_timestamp=1631031417202&other_urls=https%3A%2F%2Fregistry.nlark.com%2Freact-is%2Fdownload%2Freact-is-17.0.2.tgz}
resolution: {integrity: sha1-5pHUqOnHiTZWVVOas3J2Kw77VPA=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/react-is/download/react-is-17.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Freact-is%2Fdownload%2Freact-is-17.0.2.tgz}
name: react-is
version: 17.0.2
dev: false
@ -5151,10 +5200,10 @@ packages:
tslib: registry.nlark.com/tslib/1.14.1
dev: true
registry.nlark.com/sass/1.39.2:
resolution: {integrity: sha1-FoGWQ3j1jXb8ZKalAmGb1ayZ9mA=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/sass/download/sass-1.39.2.tgz?cache=0&sync_timestamp=1631232791563&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsass%2Fdownload%2Fsass-1.39.2.tgz}
registry.nlark.com/sass/1.40.0:
resolution: {integrity: sha1-/6cQbZwBhRafWwjqqxPWNN75SPI=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/sass/download/sass-1.40.0.tgz?cache=0&sync_timestamp=1631577412662&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsass%2Fdownload%2Fsass-1.40.0.tgz}
name: sass
version: 1.39.2
version: 1.40.0
engines: {node: '>=8.9.0'}
hasBin: true
dependencies:
@ -5439,9 +5488,6 @@ packages:
hasBin: true
peerDependencies:
typescript: ^4.2.3
peerDependenciesMeta:
typescript:
optional: true
dependencies:
cac: registry.nlark.com/cac/6.7.3
chalk: registry.nlark.com/chalk/4.1.2
@ -5458,6 +5504,7 @@ packages:
tree-kill: registry.nlark.com/tree-kill/1.2.2
typescript: registry.nlark.com/typescript/4.4.3
transitivePeerDependencies:
- supports-color
- ts-node
dev: true
@ -5513,11 +5560,11 @@ packages:
hasBin: true
dev: true
registry.nlark.com/unplugin-icons/0.9.0_54da2e3458e54be8937824c348b2c77e:
resolution: {integrity: sha1-f7DUp5NHSM8C9PrsXq9du8efBEo=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/unplugin-icons/download/unplugin-icons-0.9.0.tgz}
id: registry.nlark.com/unplugin-icons/0.9.0
registry.nlark.com/unplugin-icons/0.10.0_54da2e3458e54be8937824c348b2c77e:
resolution: {integrity: sha1-u4LobC5YdZnVLfDw0HzjB7Ivjq4=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/unplugin-icons/download/unplugin-icons-0.10.0.tgz}
id: registry.nlark.com/unplugin-icons/0.10.0
name: unplugin-icons
version: 0.9.0
version: 0.10.0
peerDependencies:
'@iconify/json': '*'
'@svgr/core': ^5.5.0
@ -5536,11 +5583,11 @@ packages:
- webpack
dev: true
registry.nlark.com/unplugin-vue-components/0.15.0_vite@2.5.7+vue@3.2.10:
resolution: {integrity: sha1-XxJNcPFm+KzgWtnOkjCoToswasU=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/unplugin-vue-components/download/unplugin-vue-components-0.15.0.tgz}
id: registry.nlark.com/unplugin-vue-components/0.15.0
registry.nlark.com/unplugin-vue-components/0.15.1_vite@2.5.7+vue@3.2.10:
resolution: {integrity: sha1-YIM9+fVOXu3efZFsK6ZumiY3mKc=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/unplugin-vue-components/download/unplugin-vue-components-0.15.1.tgz?cache=0&sync_timestamp=1631586147989&other_urls=https%3A%2F%2Fregistry.nlark.com%2Funplugin-vue-components%2Fdownload%2Funplugin-vue-components-0.15.1.tgz}
id: registry.nlark.com/unplugin-vue-components/0.15.1
name: unplugin-vue-components
version: 0.15.0
version: 0.15.1
engines: {node: '>=14'}
peerDependencies:
vue: 2 || 3
@ -5553,38 +5600,17 @@ packages:
magic-string: registry.nlark.com/magic-string/0.25.7
minimatch: registry.nlark.com/minimatch/3.0.4
resolve: 1.20.0
unplugin: registry.nlark.com/unplugin/0.2.7_vite@2.5.7
unplugin: registry.nlark.com/unplugin/0.2.9_vite@2.5.7
vue: registry.nlark.com/vue/3.2.10
transitivePeerDependencies:
- rollup
- supports-color
- vite
- webpack
dev: true
registry.nlark.com/unplugin/0.2.7_vite@2.5.7:
resolution: {integrity: sha1-QAchRSh5Q6u8VSGF7n3xUlkyEz0=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/unplugin/download/unplugin-0.2.7.tgz}
id: registry.nlark.com/unplugin/0.2.7
name: unplugin
version: 0.2.7
peerDependencies:
rollup: ^2.50.0
vite: ^2.3.0
webpack: ^4.0.0
peerDependenciesMeta:
rollup:
optional: true
vite:
optional: true
webpack:
optional: true
dependencies:
upath: 2.0.1
vite: registry.nlark.com/vite/2.5.7
webpack-virtual-modules: registry.nlark.com/webpack-virtual-modules/0.4.3
dev: true
registry.nlark.com/unplugin/0.2.9_vite@2.5.7:
resolution: {integrity: sha1-iEYSEROpDfjqTveLFxzXOeNrAUM=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/unplugin/download/unplugin-0.2.9.tgz}
resolution: {integrity: sha1-iEYSEROpDfjqTveLFxzXOeNrAUM=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/unplugin/download/unplugin-0.2.9.tgz}
id: registry.nlark.com/unplugin/0.2.9
name: unplugin
version: 0.2.9
@ -5640,20 +5666,21 @@ packages:
vite: registry.nlark.com/vite/2.5.7
dev: true
registry.nlark.com/vite-plugin-windicss/1.4.2_typescript@4.4.3+vite@2.5.7:
resolution: {integrity: sha1-B1z160lGk9FtQLSr6Yh7YfR8Du8=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/vite-plugin-windicss/download/vite-plugin-windicss-1.4.2.tgz}
id: registry.nlark.com/vite-plugin-windicss/1.4.2
registry.nlark.com/vite-plugin-windicss/1.4.3_typescript@4.4.3+vite@2.5.7:
resolution: {integrity: sha1-c1oeNeh7lSk9UrnnVw7KlsO3JFs=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/vite-plugin-windicss/download/vite-plugin-windicss-1.4.3.tgz}
id: registry.nlark.com/vite-plugin-windicss/1.4.3
name: vite-plugin-windicss
version: 1.4.2
version: 1.4.3
peerDependencies:
vite: ^2.0.1
dependencies:
'@windicss/plugin-utils': registry.nlark.com/@windicss/plugin-utils/1.4.2_typescript@4.4.3
'@windicss/plugin-utils': registry.nlark.com/@windicss/plugin-utils/1.4.3_typescript@4.4.3
chalk: registry.nlark.com/chalk/4.1.2
debug: registry.nlark.com/debug/4.3.2
vite: registry.nlark.com/vite/2.5.7
windicss: registry.nlark.com/windicss/3.1.7
transitivePeerDependencies:
- supports-color
- ts-node
- typescript
dev: true
@ -5843,6 +5870,9 @@ packages:
peerDependencies:
'@vue/composition-api': ^1.0.0-rc.1
vue: ^3.0.0-0 || ^2.6.0
peerDependenciesMeta:
'@vue/composition-api':
optional: true
dependencies:
vue: registry.nlark.com/vue/3.2.10
dev: false
@ -5864,6 +5894,8 @@ packages:
esquery: 1.4.0
lodash: 4.17.21
semver: 6.3.0
transitivePeerDependencies:
- supports-color
dev: true
registry.nlark.com/vue-router/4.0.11_vue@3.2.10:
@ -5921,7 +5953,7 @@ packages:
dev: false
registry.nlark.com/webpack-virtual-modules/0.4.3:
resolution: {integrity: sha1-zVl8bVHVpey0c+6hmDpY+ooX3tk=, registry: http://registry.npm.taobao.org/, tarball: https://registry.nlark.com/webpack-virtual-modules/download/webpack-virtual-modules-0.4.3.tgz?cache=0&sync_timestamp=1620993523325&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwebpack-virtual-modules%2Fdownload%2Fwebpack-virtual-modules-0.4.3.tgz}
resolution: {integrity: sha1-zVl8bVHVpey0c+6hmDpY+ooX3tk=, registry: https://registry.npm.taobao.org/, tarball: https://registry.nlark.com/webpack-virtual-modules/download/webpack-virtual-modules-0.4.3.tgz?cache=0&sync_timestamp=1620993523325&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwebpack-virtual-modules%2Fdownload%2Fwebpack-virtual-modules-0.4.3.tgz}
name: webpack-virtual-modules
version: 0.4.3
dev: true

View File

@ -2,5 +2,6 @@ import useAppTitle from './useAppTitle';
import useCreateContext from './useCreateContext';
import useRouterChange from './useRouterChange';
import useRouteParam from './useRouteParam';
import useScrollBehavior from './useScrollBehavior';
export { useAppTitle, useCreateContext, useRouterChange, useRouteParam };
export { useAppTitle, useCreateContext, useRouterChange, useRouteParam, useScrollBehavior };

View File

@ -0,0 +1,25 @@
import { ref, watch } from 'vue';
import { useRoute } from 'vue-router';
export default function useScrollBehavior() {
const scrollbar = ref<HTMLElement | null>(null);
const route = useRoute();
function resetScrollBehavior() {
scrollbar.value?.scrollTo({ left: 0, top: 0 });
}
function resetScrollWatcher() {
watch(
() => route.name,
() => {
resetScrollBehavior();
}
);
}
return {
scrollbar,
resetScrollWatcher
};
}

View File

@ -1,2 +1,2 @@
export { useAppTitle, useCreateContext, useRouterChange, useRouteParam } from './common';
export { useAppTitle, useCreateContext, useRouterChange, useRouteParam, useScrollBehavior } from './common';
export { useCountDown, useSmsCode } from './business';

View File

@ -1,3 +1,4 @@
import type { RouteRecordRaw } from 'vue-router';
import { EnumRoutePath, EnumLoginModule } from '@/enum';
/** 路由描述 */
@ -12,5 +13,8 @@ export interface RouteMeta {
icon?: string;
}
export type CustomRoute = RouteRecordRaw & { meta: RouteMeta };
export type RoutePathKey = keyof typeof EnumRoutePath;
export type LoginModuleType = keyof typeof EnumLoginModule;

View File

@ -1,3 +1,3 @@
export { UserInfo } from './business';
export { ThemeSettings, NavMode, AnimateType } from './theme';
export { RouteMeta, RoutePathKey, LoginModuleType } from './common';
export { CustomRoute, RoutePathKey, LoginModuleType } from './common';

View File

@ -4,7 +4,7 @@
<global-header v-if="isHorizontalMix" :z-index="2" />
<div class="flex-1-hidden flex h-full">
<global-sider v-if="isHorizontalMix" class="sider-margin" :z-index="1" />
<n-scrollbar class="h-full" :x-scrollable="true" :content-class="fullPage ? 'h-full' : ''">
<n-scrollbar ref="scrollbar" class="h-full" :x-scrollable="true" :content-class="fullPage ? 'h-full' : ''">
<div
class="inline-flex-col-stretch w-full"
:class="[{ 'content-padding': isHorizontalMix }, fullPage ? 'h-full' : 'min-h-100vh']"
@ -26,10 +26,12 @@ import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { NLayout, NScrollbar, NLayoutContent } from 'naive-ui';
import { useThemeStore } from '@/store';
import { useScrollBehavior } from '@/hooks';
import { GlobalSider, GlobalHeader, GlobalFooter, SettingDrawer } from './components';
const route = useRoute();
const theme = useThemeStore();
const { scrollbar, resetScrollWatcher } = useScrollBehavior();
const isHorizontalMix = computed(() => theme.navStyle.mode === 'horizontal-mix');
const headerHeight = computed(() => {
@ -38,6 +40,9 @@ const headerHeight = computed(() => {
});
/** 100%视高 */
const fullPage = computed(() => Boolean(route.meta?.fullPage));
//
resetScrollWatcher();
</script>
<style scoped>
:deep(.n-scrollbar-rail) {

View File

@ -1,5 +1,5 @@
<template>
<n-scrollbar class="h-full" :x-scrollable="true" :content-class="fullPage ? 'h-full' : ''">
<n-scrollbar ref="scrollbar" class="h-full" :x-scrollable="true" :content-class="fullPage ? 'h-full' : ''">
<div class="inline-block w-full" :class="[fullPage ? 'h-full' : 'min-h-100vh']">
<router-view />
</div>
@ -10,9 +10,14 @@
import { useRoute } from 'vue-router';
import { NScrollbar } from 'naive-ui';
import { computed } from 'vue';
import { useScrollBehavior } from '@/hooks';
const route = useRoute();
const { scrollbar, resetScrollWatcher } = useScrollBehavior();
/** 100%视高 */
const fullPage = computed(() => Boolean(route.meta?.fullPage));
resetScrollWatcher();
</script>
<style scoped></style>

View File

@ -11,8 +11,7 @@ const isVercel = import.meta.env.VITE_HTTP_ENV === 'VERCEL';
const router = createRouter({
history: isVercel ? createWebHashHistory() : createWebHistory(),
routes,
scrollBehavior: () => ({ left: 0, top: 0 })
routes
});
export async function setupRouter(app: App) {

5
src/router/menus.ts Normal file
View File

@ -0,0 +1,5 @@
import { CustomRoute } from '@/interface';
export function transformRouteToMenu(routes: CustomRoute[]) {
return routes;
}

View File

@ -1,7 +1,7 @@
import type { RouteRecordRaw } from 'vue-router';
import { BasicLayout, BlankLayout } from '@/layouts';
import { EnumRoutePath, EnumRouteTitle } from '@/enum';
import type { RoutePathKey, LoginModuleType } from '@/interface';
import type { CustomRoute, RoutePathKey, LoginModuleType } from '@/interface';
import { getLoginModuleRegExp } from '@/utils';
/** 路由名称 */
@ -83,7 +83,7 @@ export const constantRoutes: RouteRecordRaw[] = [
/**
*
*/
export const customRoutes: Array<RouteRecordRaw> = [
export const customRoutes: CustomRoute[] = [
{
name: RouteNameMap.get('root'),
path: EnumRoutePath.root,