version: v4.4.3

This commit is contained in:
XiaoDaiGua-Ray 2023-12-06 12:28:56 +08:00
parent c304f37146
commit 5299a0245f
14 changed files with 413 additions and 136 deletions

View File

@ -1,5 +1,25 @@
# CHANGE LOG # CHANGE LOG
## 4.4.3
更新 `vue` 版本至 `3.3.10`
补充了一些代码的注释(慢慢还账--)。
## Feats
- 更新 `vue` 版本至 `3.3.10`
- 新增 `useElementFullscreen` 方法,用于全屏元素。但是该全屏区别于浏览器全屏元素,仅是网页全屏效果
- 使用 `useElementFullscreen` 方法重构 `maximize` 方法
- `changeMenuModelValue`
- 现在方法支持第三个参数配置跳转时,是否携带参数
- 避免递归查找的时候,一些不必要的操作,优化性能
## Fixes
- 修复了通过 `url` 携带参数跳转页面,参数可能会被拦截并且丢失的问题
- 修复了 `url` 跳转页面导致多次更新的问题
## 4.4.2 ## 4.4.2
这是一个具有破坏性更新的版本,如果你使用了该模板,那么你需要做一些改动。 这是一个具有破坏性更新的版本,如果你使用了该模板,那么你需要做一些改动。

View File

@ -1,7 +1,7 @@
{ {
"name": "ray-template", "name": "ray-template",
"private": false, "private": false,
"version": "4.4.2", "version": "4.4.3",
"type": "module", "type": "module",
"engines": { "engines": {
"node": "^18.0.0 || >=20.0.0", "node": "^18.0.0 || >=20.0.0",
@ -39,7 +39,7 @@
"pinia": "^2.1.6", "pinia": "^2.1.6",
"pinia-plugin-persistedstate": "^3.2.0", "pinia-plugin-persistedstate": "^3.2.0",
"print-js": "^1.6.0", "print-js": "^1.6.0",
"vue": "^3.3.8", "vue": "^3.3.10",
"vue-hooks-plus": "1.8.5", "vue-hooks-plus": "1.8.5",
"vue-i18n": "^9.7.1", "vue-i18n": "^9.7.1",
"vue-router": "^4.2.4", "vue-router": "^4.2.4",

241
pnpm-lock.yaml generated
View File

@ -7,7 +7,7 @@ settings:
dependencies: dependencies:
'@vueuse/core': '@vueuse/core':
specifier: ^10.6.1 specifier: ^10.6.1
version: 10.6.1(vue@3.3.8) version: 10.6.1(vue@3.3.10)
awesome-qr: awesome-qr:
specifier: 2.1.5-rc.0 specifier: 2.1.5-rc.0
version: 2.1.5-rc.0 version: 2.1.5-rc.0
@ -40,10 +40,10 @@ dependencies:
version: 1.1.0 version: 1.1.0
naive-ui: naive-ui:
specifier: ^2.35.0 specifier: ^2.35.0
version: 2.35.0(vue@3.3.8) version: 2.35.0(vue@3.3.10)
pinia: pinia:
specifier: ^2.1.6 specifier: ^2.1.6
version: 2.1.6(typescript@5.2.2)(vue@3.3.8) version: 2.1.6(typescript@5.2.2)(vue@3.3.10)
pinia-plugin-persistedstate: pinia-plugin-persistedstate:
specifier: ^3.2.0 specifier: ^3.2.0
version: 3.2.0(pinia@2.1.6) version: 3.2.0(pinia@2.1.6)
@ -51,17 +51,17 @@ dependencies:
specifier: ^1.6.0 specifier: ^1.6.0
version: 1.6.0 version: 1.6.0
vue: vue:
specifier: ^3.3.8 specifier: ^3.3.10
version: 3.3.8(typescript@5.2.2) version: 3.3.10(typescript@5.2.2)
vue-hooks-plus: vue-hooks-plus:
specifier: 1.8.5 specifier: 1.8.5
version: 1.8.5(vue@3.3.8) version: 1.8.5(vue@3.3.10)
vue-i18n: vue-i18n:
specifier: ^9.7.1 specifier: ^9.7.1
version: 9.7.1(vue@3.3.8) version: 9.7.1(vue@3.3.10)
vue-router: vue-router:
specifier: ^4.2.4 specifier: ^4.2.4
version: 4.2.4(vue@3.3.8) version: 4.2.4(vue@3.3.10)
xlsx: xlsx:
specifier: ^0.18.5 specifier: ^0.18.5
version: 0.18.5 version: 0.18.5
@ -102,10 +102,10 @@ devDependencies:
version: 6.5.0(eslint@8.52.0)(typescript@5.2.2) version: 6.5.0(eslint@8.52.0)(typescript@5.2.2)
'@vitejs/plugin-vue': '@vitejs/plugin-vue':
specifier: ^4.4.1 specifier: ^4.4.1
version: 4.4.1(vite@5.0.4)(vue@3.3.8) version: 4.4.1(vite@5.0.4)(vue@3.3.10)
'@vitejs/plugin-vue-jsx': '@vitejs/plugin-vue-jsx':
specifier: ^3.0.2 specifier: ^3.0.2
version: 3.0.2(vite@5.0.4)(vue@3.3.8) version: 3.0.2(vite@5.0.4)(vue@3.3.10)
'@vue-hooks-plus/resolvers': '@vue-hooks-plus/resolvers':
specifier: 1.2.4 specifier: 1.2.4
version: 1.2.4(vue-hooks-plus@1.8.5) version: 1.2.4(vue-hooks-plus@1.8.5)
@ -177,7 +177,7 @@ devDependencies:
version: 0.16.6(@vueuse/core@10.6.1) version: 0.16.6(@vueuse/core@10.6.1)
unplugin-vue-components: unplugin-vue-components:
specifier: ^0.25.2 specifier: ^0.25.2
version: 0.25.2(vue@3.3.8) version: 0.25.2(vue@3.3.10)
vite: vite:
specifier: ^5.0.4 specifier: ^5.0.4
version: 5.0.4(@types/node@20.4.7)(sass@1.69.5) version: 5.0.4(@types/node@20.4.7)(sass@1.69.5)
@ -446,6 +446,11 @@ packages:
/@babel/helper-string-parser@7.22.5: /@babel/helper-string-parser@7.22.5:
resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
dev: true
/@babel/helper-string-parser@7.23.4:
resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==}
engines: {node: '>=6.9.0'}
/@babel/helper-validator-identifier@7.22.20: /@babel/helper-validator-identifier@7.22.20:
resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==}
@ -490,6 +495,14 @@ packages:
hasBin: true hasBin: true
dependencies: dependencies:
'@babel/types': 7.23.3 '@babel/types': 7.23.3
dev: true
/@babel/parser@7.23.5:
resolution: {integrity: sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==}
engines: {node: '>=6.0.0'}
hasBin: true
dependencies:
'@babel/types': 7.23.5
/@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.23.2): /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.23.2):
resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==}
@ -601,6 +614,15 @@ packages:
'@babel/helper-string-parser': 7.22.5 '@babel/helper-string-parser': 7.22.5
'@babel/helper-validator-identifier': 7.22.20 '@babel/helper-validator-identifier': 7.22.20
to-fast-properties: 2.0.0 to-fast-properties: 2.0.0
dev: true
/@babel/types@7.23.5:
resolution: {integrity: sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/helper-string-parser': 7.23.4
'@babel/helper-validator-identifier': 7.22.20
to-fast-properties: 2.0.0
/@commitlint/cli@17.7.1: /@commitlint/cli@17.7.1:
resolution: {integrity: sha512-BCm/AT06SNCQtvFv921iNhudOHuY16LswT0R3OeolVGLk8oP+Rk9TfQfgjH7QPMjhvp76bNqGFEcpKojxUNW1g==} resolution: {integrity: sha512-BCm/AT06SNCQtvFv921iNhudOHuY16LswT0R3OeolVGLk8oP+Rk9TfQfgjH7QPMjhvp76bNqGFEcpKojxUNW1g==}
@ -785,12 +807,12 @@ packages:
css-render: 0.15.12 css-render: 0.15.12
dev: false dev: false
/@css-render/vue3-ssr@0.15.12(vue@3.3.8): /@css-render/vue3-ssr@0.15.12(vue@3.3.10):
resolution: {integrity: sha512-AQLGhhaE0F+rwybRCkKUdzBdTEM/5PZBYy+fSYe1T9z9+yxMuV/k7ZRqa4M69X+EI1W8pa4kc9Iq2VjQkZx4rg==} resolution: {integrity: sha512-AQLGhhaE0F+rwybRCkKUdzBdTEM/5PZBYy+fSYe1T9z9+yxMuV/k7ZRqa4M69X+EI1W8pa4kc9Iq2VjQkZx4rg==}
peerDependencies: peerDependencies:
vue: ^3.0.11 vue: ^3.0.11
dependencies: dependencies:
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
dev: false dev: false
/@emotion/hash@0.8.0: /@emotion/hash@0.8.0:
@ -1274,7 +1296,7 @@ packages:
magic-string: 0.30.5 magic-string: 0.30.5
mlly: 1.4.1 mlly: 1.4.1
source-map-js: 1.0.2 source-map-js: 1.0.2
vue-i18n: 9.7.1(vue@3.3.8) vue-i18n: 9.7.1(vue@3.3.10)
yaml-eslint-parser: 1.2.2 yaml-eslint-parser: 1.2.2
dev: true dev: true
@ -1336,7 +1358,7 @@ packages:
picocolors: 1.0.0 picocolors: 1.0.0
source-map-js: 1.0.2 source-map-js: 1.0.2
unplugin: 1.4.0 unplugin: 1.4.0
vue-i18n: 9.7.1(vue@3.3.8) vue-i18n: 9.7.1(vue@3.3.10)
transitivePeerDependencies: transitivePeerDependencies:
- rollup - rollup
- supports-color - supports-color
@ -1932,7 +1954,7 @@ packages:
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
dev: true dev: true
/@vitejs/plugin-vue-jsx@3.0.2(vite@5.0.4)(vue@3.3.8): /@vitejs/plugin-vue-jsx@3.0.2(vite@5.0.4)(vue@3.3.10):
resolution: {integrity: sha512-obF26P2Z4Ogy3cPp07B4VaW6rpiu0ue4OT2Y15UxT5BZZ76haUY9guOsZV3uWh/I6xc+VeiW+ZVabRE82FyzWw==} resolution: {integrity: sha512-obF26P2Z4Ogy3cPp07B4VaW6rpiu0ue4OT2Y15UxT5BZZ76haUY9guOsZV3uWh/I6xc+VeiW+ZVabRE82FyzWw==}
engines: {node: ^14.18.0 || >=16.0.0} engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies: peerDependencies:
@ -1943,12 +1965,12 @@ packages:
'@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.23.2) '@babel/plugin-transform-typescript': 7.22.15(@babel/core@7.23.2)
'@vue/babel-plugin-jsx': 1.1.5(@babel/core@7.23.2) '@vue/babel-plugin-jsx': 1.1.5(@babel/core@7.23.2)
vite: 5.0.4(@types/node@20.4.7)(sass@1.69.5) vite: 5.0.4(@types/node@20.4.7)(sass@1.69.5)
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
dev: true dev: true
/@vitejs/plugin-vue@4.4.1(vite@5.0.4)(vue@3.3.8): /@vitejs/plugin-vue@4.4.1(vite@5.0.4)(vue@3.3.10):
resolution: {integrity: sha512-HCQG8VDFDM7YDAdcj5QI5DvUi+r6xvo9LgvYdk7LSkUNwdpempdB5horkMSZsbdey9Ywsf5aaU8kEPw9M5kREA==} resolution: {integrity: sha512-HCQG8VDFDM7YDAdcj5QI5DvUi+r6xvo9LgvYdk7LSkUNwdpempdB5horkMSZsbdey9Ywsf5aaU8kEPw9M5kREA==}
engines: {node: ^14.18.0 || >=16.0.0} engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies: peerDependencies:
@ -1956,7 +1978,7 @@ packages:
vue: ^3.2.25 vue: ^3.2.25
dependencies: dependencies:
vite: 5.0.4(@types/node@20.4.7)(sass@1.69.5) vite: 5.0.4(@types/node@20.4.7)(sass@1.69.5)
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
dev: true dev: true
/@volar/language-core@1.10.1: /@volar/language-core@1.10.1:
@ -1984,7 +2006,7 @@ packages:
vue-hooks-plus: ^1.5.2 vue-hooks-plus: ^1.5.2
dependencies: dependencies:
local-pkg: 0.4.3 local-pkg: 0.4.3
vue-hooks-plus: 1.8.5(vue@3.3.8) vue-hooks-plus: 1.8.5(vue@3.3.10)
dev: true dev: true
/@vue/babel-helper-vue-transform-on@1.1.5: /@vue/babel-helper-vue-transform-on@1.1.5:
@ -2010,6 +2032,14 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@vue/compiler-core@3.3.10:
resolution: {integrity: sha512-doe0hODR1+i1menPkRzJ5MNR6G+9uiZHIknK3Zn5OcIztu6GGw7u0XUzf3AgB8h/dfsZC9eouzoLo3c3+N/cVA==}
dependencies:
'@babel/parser': 7.23.5
'@vue/shared': 3.3.10
estree-walker: 2.0.2
source-map-js: 1.0.2
/@vue/compiler-core@3.3.8: /@vue/compiler-core@3.3.8:
resolution: {integrity: sha512-hN/NNBUECw8SusQvDSqqcVv6gWq8L6iAktUR0UF3vGu2OhzRqcOiAno0FmBJWwxhYEXRlQJT5XnoKsVq1WZx4g==} resolution: {integrity: sha512-hN/NNBUECw8SusQvDSqqcVv6gWq8L6iAktUR0UF3vGu2OhzRqcOiAno0FmBJWwxhYEXRlQJT5XnoKsVq1WZx4g==}
dependencies: dependencies:
@ -2017,12 +2047,34 @@ packages:
'@vue/shared': 3.3.8 '@vue/shared': 3.3.8
estree-walker: 2.0.2 estree-walker: 2.0.2
source-map-js: 1.0.2 source-map-js: 1.0.2
dev: true
/@vue/compiler-dom@3.3.10:
resolution: {integrity: sha512-NCrqF5fm10GXZIK0GrEAauBqdy+F2LZRt3yNHzrYjpYBuRssQbuPLtSnSNjyR9luHKkWSH8we5LMB3g+4z2HvA==}
dependencies:
'@vue/compiler-core': 3.3.10
'@vue/shared': 3.3.10
/@vue/compiler-dom@3.3.8: /@vue/compiler-dom@3.3.8:
resolution: {integrity: sha512-+PPtv+p/nWDd0AvJu3w8HS0RIm/C6VGBIRe24b9hSyNWOAPEUosFZ5diwawwP8ip5sJ8n0Pe87TNNNHnvjs0FQ==} resolution: {integrity: sha512-+PPtv+p/nWDd0AvJu3w8HS0RIm/C6VGBIRe24b9hSyNWOAPEUosFZ5diwawwP8ip5sJ8n0Pe87TNNNHnvjs0FQ==}
dependencies: dependencies:
'@vue/compiler-core': 3.3.8 '@vue/compiler-core': 3.3.8
'@vue/shared': 3.3.8 '@vue/shared': 3.3.8
dev: true
/@vue/compiler-sfc@3.3.10:
resolution: {integrity: sha512-xpcTe7Rw7QefOTRFFTlcfzozccvjM40dT45JtrE3onGm/jBLZ0JhpKu3jkV7rbDFLeeagR/5RlJ2Y9SvyS0lAg==}
dependencies:
'@babel/parser': 7.23.5
'@vue/compiler-core': 3.3.10
'@vue/compiler-dom': 3.3.10
'@vue/compiler-ssr': 3.3.10
'@vue/reactivity-transform': 3.3.10
'@vue/shared': 3.3.10
estree-walker: 2.0.2
magic-string: 0.30.5
postcss: 8.4.32
source-map-js: 1.0.2
/@vue/compiler-sfc@3.3.8: /@vue/compiler-sfc@3.3.8:
resolution: {integrity: sha512-WMzbUrlTjfYF8joyT84HfwwXo+8WPALuPxhy+BZ6R4Aafls+jDBnSz8PDz60uFhuqFbl3HxRfxvDzrUf3THwpA==} resolution: {integrity: sha512-WMzbUrlTjfYF8joyT84HfwwXo+8WPALuPxhy+BZ6R4Aafls+jDBnSz8PDz60uFhuqFbl3HxRfxvDzrUf3THwpA==}
@ -2037,12 +2089,20 @@ packages:
magic-string: 0.30.5 magic-string: 0.30.5
postcss: 8.4.31 postcss: 8.4.31
source-map-js: 1.0.2 source-map-js: 1.0.2
dev: true
/@vue/compiler-ssr@3.3.10:
resolution: {integrity: sha512-12iM4jA4GEbskwXMmPcskK5wImc2ohKm408+o9iox3tfN9qua8xL0THIZtoe9OJHnXP4eOWZpgCAAThEveNlqQ==}
dependencies:
'@vue/compiler-dom': 3.3.10
'@vue/shared': 3.3.10
/@vue/compiler-ssr@3.3.8: /@vue/compiler-ssr@3.3.8:
resolution: {integrity: sha512-hXCqQL/15kMVDBuoBYpUnSYT8doDNwsjvm3jTefnXr+ytn294ySnT8NlsFHmTgKNjwpuFy7XVV8yTeLtNl/P6w==} resolution: {integrity: sha512-hXCqQL/15kMVDBuoBYpUnSYT8doDNwsjvm3jTefnXr+ytn294ySnT8NlsFHmTgKNjwpuFy7XVV8yTeLtNl/P6w==}
dependencies: dependencies:
'@vue/compiler-dom': 3.3.8 '@vue/compiler-dom': 3.3.8
'@vue/shared': 3.3.8 '@vue/shared': 3.3.8
dev: true
/@vue/devtools-api@6.5.1: /@vue/devtools-api@6.5.1:
resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==} resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==}
@ -2101,6 +2161,15 @@ packages:
vue-template-compiler: 2.7.14 vue-template-compiler: 2.7.14
dev: true dev: true
/@vue/reactivity-transform@3.3.10:
resolution: {integrity: sha512-0xBdk+CKHWT+Gev8oZ63Tc0qFfj935YZx+UAynlutnrDZ4diFCVFMWixn65HzjE3S1iJppWOo6Tt1OzASH7VEg==}
dependencies:
'@babel/parser': 7.23.5
'@vue/compiler-core': 3.3.10
'@vue/shared': 3.3.10
estree-walker: 2.0.2
magic-string: 0.30.5
/@vue/reactivity-transform@3.3.8: /@vue/reactivity-transform@3.3.8:
resolution: {integrity: sha512-49CvBzmZNtcHua0XJ7GdGifM8GOXoUMOX4dD40Y5DxI3R8OUhMlvf2nvgUAcPxaXiV5MQQ1Nwy09ADpnLQUqRw==} resolution: {integrity: sha512-49CvBzmZNtcHua0XJ7GdGifM8GOXoUMOX4dD40Y5DxI3R8OUhMlvf2nvgUAcPxaXiV5MQQ1Nwy09ADpnLQUqRw==}
dependencies: dependencies:
@ -2109,36 +2178,47 @@ packages:
'@vue/shared': 3.3.8 '@vue/shared': 3.3.8
estree-walker: 2.0.2 estree-walker: 2.0.2
magic-string: 0.30.5 magic-string: 0.30.5
dev: true
/@vue/reactivity@3.3.10:
resolution: {integrity: sha512-H5Z7rOY/JLO+e5a6/FEXaQ1TMuOvY4LDVgT+/+HKubEAgs9qeeZ+NhADSeEtrNQeiKLDuzeKc8v0CUFpB6Pqgw==}
dependencies:
'@vue/shared': 3.3.10
/@vue/reactivity@3.3.8: /@vue/reactivity@3.3.8:
resolution: {integrity: sha512-ctLWitmFBu6mtddPyOKpHg8+5ahouoTCRtmAHZAXmolDtuZXfjL2T3OJ6DL6ezBPQB1SmMnpzjiWjCiMYmpIuw==} resolution: {integrity: sha512-ctLWitmFBu6mtddPyOKpHg8+5ahouoTCRtmAHZAXmolDtuZXfjL2T3OJ6DL6ezBPQB1SmMnpzjiWjCiMYmpIuw==}
dependencies: dependencies:
'@vue/shared': 3.3.8 '@vue/shared': 3.3.8
dev: true
/@vue/runtime-core@3.3.8: /@vue/runtime-core@3.3.10:
resolution: {integrity: sha512-qurzOlb6q26KWQ/8IShHkMDOuJkQnQcTIp1sdP4I9MbCf9FJeGVRXJFr2mF+6bXh/3Zjr9TDgURXrsCr9bfjUw==} resolution: {integrity: sha512-DZ0v31oTN4YHX9JEU5VW1LoIVgFovWgIVb30bWn9DG9a7oA415idcwsRNNajqTx8HQJyOaWfRKoyuP2P2TYIag==}
dependencies: dependencies:
'@vue/reactivity': 3.3.8 '@vue/reactivity': 3.3.10
'@vue/shared': 3.3.8 '@vue/shared': 3.3.10
/@vue/runtime-dom@3.3.8: /@vue/runtime-dom@3.3.10:
resolution: {integrity: sha512-Noy5yM5UIf9UeFoowBVgghyGGPIDPy1Qlqt0yVsUdAVbqI8eeMSsTqBtauaEoT2UFXUk5S64aWVNJN4MJ2vRdA==} resolution: {integrity: sha512-c/jKb3ny05KJcYk0j1m7Wbhrxq7mZYr06GhKykDMNRRR9S+/dGT8KpHuNQjv3/8U4JshfkAk6TpecPD3B21Ijw==}
dependencies: dependencies:
'@vue/runtime-core': 3.3.8 '@vue/runtime-core': 3.3.10
'@vue/shared': 3.3.8 '@vue/shared': 3.3.10
csstype: 3.1.2 csstype: 3.1.2
/@vue/server-renderer@3.3.8(vue@3.3.8): /@vue/server-renderer@3.3.10(vue@3.3.10):
resolution: {integrity: sha512-zVCUw7RFskvPuNlPn/8xISbrf0zTWsTSdYTsUTN1ERGGZGVnRxM2QZ3x1OR32+vwkkCm0IW6HmJ49IsPm7ilLg==} resolution: {integrity: sha512-0i6ww3sBV3SKlF3YTjSVqKQ74xialMbjVYGy7cOTi7Imd8ediE7t72SK3qnvhrTAhOvlQhq6Bk6nFPdXxe0sAg==}
peerDependencies: peerDependencies:
vue: 3.3.8 vue: 3.3.10
dependencies: dependencies:
'@vue/compiler-ssr': 3.3.8 '@vue/compiler-ssr': 3.3.10
'@vue/shared': 3.3.8 '@vue/shared': 3.3.10
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
/@vue/shared@3.3.10:
resolution: {integrity: sha512-2y3Y2J1a3RhFa0WisHvACJR2ncvWiVHcP8t0Inxo+NKz+8RKO4ZV8eZgCxRgQoA6ITfV12L4E6POOL9HOU5nqw==}
/@vue/shared@3.3.8: /@vue/shared@3.3.8:
resolution: {integrity: sha512-8PGwybFwM4x8pcfgqEQFy70NaQxASvOC5DJwLQfpArw1UDfUXrJkdxD3BhVTMS+0Lef/TU7YO0Jvr0jJY8T+mw==} resolution: {integrity: sha512-8PGwybFwM4x8pcfgqEQFy70NaQxASvOC5DJwLQfpArw1UDfUXrJkdxD3BhVTMS+0Lef/TU7YO0Jvr0jJY8T+mw==}
dev: true
/@vue/typescript@1.8.8(typescript@5.2.2): /@vue/typescript@1.8.8(typescript@5.2.2):
resolution: {integrity: sha512-jUnmMB6egu5wl342eaUH236v8tdcEPXXkPgj+eI/F6JwW/lb+yAU6U07ZbQ3MVabZRlupIlPESB7ajgAGixhow==} resolution: {integrity: sha512-jUnmMB6egu5wl342eaUH236v8tdcEPXXkPgj+eI/F6JwW/lb+yAU6U07ZbQ3MVabZRlupIlPESB7ajgAGixhow==}
@ -2149,13 +2229,13 @@ packages:
- typescript - typescript
dev: true dev: true
/@vueuse/core@10.6.1(vue@3.3.8): /@vueuse/core@10.6.1(vue@3.3.10):
resolution: {integrity: sha512-Pc26IJbqgC9VG1u6VY/xrXXfxD33hnvxBnKrLlA2LJlyHII+BSrRoTPJgGYq7qZOu61itITFUnm6QbacwZ4H8Q==} resolution: {integrity: sha512-Pc26IJbqgC9VG1u6VY/xrXXfxD33hnvxBnKrLlA2LJlyHII+BSrRoTPJgGYq7qZOu61itITFUnm6QbacwZ4H8Q==}
dependencies: dependencies:
'@types/web-bluetooth': 0.0.20 '@types/web-bluetooth': 0.0.20
'@vueuse/metadata': 10.6.1 '@vueuse/metadata': 10.6.1
'@vueuse/shared': 10.6.1(vue@3.3.8) '@vueuse/shared': 10.6.1(vue@3.3.10)
vue-demi: 0.14.6(vue@3.3.8) vue-demi: 0.14.6(vue@3.3.10)
transitivePeerDependencies: transitivePeerDependencies:
- '@vue/composition-api' - '@vue/composition-api'
- vue - vue
@ -2163,10 +2243,10 @@ packages:
/@vueuse/metadata@10.6.1: /@vueuse/metadata@10.6.1:
resolution: {integrity: sha512-qhdwPI65Bgcj23e5lpGfQsxcy0bMjCAsUGoXkJ7DsoeDUdasbZ2DBa4dinFCOER3lF4gwUv+UD2AlA11zdzMFw==} resolution: {integrity: sha512-qhdwPI65Bgcj23e5lpGfQsxcy0bMjCAsUGoXkJ7DsoeDUdasbZ2DBa4dinFCOER3lF4gwUv+UD2AlA11zdzMFw==}
/@vueuse/shared@10.6.1(vue@3.3.8): /@vueuse/shared@10.6.1(vue@3.3.10):
resolution: {integrity: sha512-TECVDTIedFlL0NUfHWncf3zF9Gc4VfdxfQc8JFwoVZQmxpONhLxFrlm0eHQeidHj4rdTPL3KXJa0TZCk1wnc5Q==} resolution: {integrity: sha512-TECVDTIedFlL0NUfHWncf3zF9Gc4VfdxfQc8JFwoVZQmxpONhLxFrlm0eHQeidHj4rdTPL3KXJa0TZCk1wnc5Q==}
dependencies: dependencies:
vue-demi: 0.14.6(vue@3.3.8) vue-demi: 0.14.6(vue@3.3.10)
transitivePeerDependencies: transitivePeerDependencies:
- '@vue/composition-api' - '@vue/composition-api'
- vue - vue
@ -5707,13 +5787,13 @@ packages:
minimatch: 3.1.2 minimatch: 3.1.2
dev: true dev: true
/naive-ui@2.35.0(vue@3.3.8): /naive-ui@2.35.0(vue@3.3.10):
resolution: {integrity: sha512-PdnLpOip1LQaKs5+rXLZoPDPQkTq26TnHWeABvUA2eOQjtHxE4+TQvj0Jq/W8clM2On/7jptoGmenLt48G3Bhg==} resolution: {integrity: sha512-PdnLpOip1LQaKs5+rXLZoPDPQkTq26TnHWeABvUA2eOQjtHxE4+TQvj0Jq/W8clM2On/7jptoGmenLt48G3Bhg==}
peerDependencies: peerDependencies:
vue: ^3.0.0 vue: ^3.0.0
dependencies: dependencies:
'@css-render/plugin-bem': 0.15.12(css-render@0.15.12) '@css-render/plugin-bem': 0.15.12(css-render@0.15.12)
'@css-render/vue3-ssr': 0.15.12(vue@3.3.8) '@css-render/vue3-ssr': 0.15.12(vue@3.3.10)
'@types/katex': 0.16.2 '@types/katex': 0.16.2
'@types/lodash': 4.14.199 '@types/lodash': 4.14.199
'@types/lodash-es': 4.17.11 '@types/lodash-es': 4.17.11
@ -5727,10 +5807,10 @@ packages:
lodash-es: 4.17.21 lodash-es: 4.17.21
seemly: 0.3.6 seemly: 0.3.6
treemate: 0.3.11 treemate: 0.3.11
vdirs: 0.1.8(vue@3.3.8) vdirs: 0.1.8(vue@3.3.10)
vooks: 0.2.12(vue@3.3.8) vooks: 0.2.12(vue@3.3.10)
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
vueuc: 0.4.51(vue@3.3.8) vueuc: 0.4.51(vue@3.3.10)
dev: false dev: false
/nan@2.17.0: /nan@2.17.0:
@ -6113,10 +6193,10 @@ packages:
peerDependencies: peerDependencies:
pinia: ^2.0.0 pinia: ^2.0.0
dependencies: dependencies:
pinia: 2.1.6(typescript@5.2.2)(vue@3.3.8) pinia: 2.1.6(typescript@5.2.2)(vue@3.3.10)
dev: false dev: false
/pinia@2.1.6(typescript@5.2.2)(vue@3.3.8): /pinia@2.1.6(typescript@5.2.2)(vue@3.3.10):
resolution: {integrity: sha512-bIU6QuE5qZviMmct5XwCesXelb5VavdOWKWaB17ggk++NUwQWWbP5YnsONTk3b752QkW9sACiR81rorpeOMSvQ==} resolution: {integrity: sha512-bIU6QuE5qZviMmct5XwCesXelb5VavdOWKWaB17ggk++NUwQWWbP5YnsONTk3b752QkW9sACiR81rorpeOMSvQ==}
peerDependencies: peerDependencies:
'@vue/composition-api': ^1.4.0 '@vue/composition-api': ^1.4.0
@ -6130,8 +6210,8 @@ packages:
dependencies: dependencies:
'@vue/devtools-api': 6.5.1 '@vue/devtools-api': 6.5.1
typescript: 5.2.2 typescript: 5.2.2
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
vue-demi: 0.14.6(vue@3.3.8) vue-demi: 0.14.6(vue@3.3.10)
dev: false dev: false
/pkg-types@1.0.3: /pkg-types@1.0.3:
@ -6196,6 +6276,15 @@ packages:
nanoid: 3.3.7 nanoid: 3.3.7
picocolors: 1.0.0 picocolors: 1.0.0
source-map-js: 1.0.2 source-map-js: 1.0.2
dev: true
/postcss@8.4.32:
resolution: {integrity: sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==}
engines: {node: ^10 || ^12 || >=14}
dependencies:
nanoid: 3.3.7
picocolors: 1.0.0
source-map-js: 1.0.2
/posthtml-parser@0.2.1: /posthtml-parser@0.2.1:
resolution: {integrity: sha512-nPC53YMqJnc/+1x4fRYFfm81KV2V+G9NZY+hTohpYg64Ay7NemWWcV4UWuy/SgMupqQ3kJ88M/iRfZmSnxT+pw==} resolution: {integrity: sha512-nPC53YMqJnc/+1x4fRYFfm81KV2V+G9NZY+hTohpYg64Ay7NemWWcV4UWuy/SgMupqQ3kJ88M/iRfZmSnxT+pw==}
@ -7394,7 +7483,7 @@ packages:
dependencies: dependencies:
'@antfu/utils': 0.7.6 '@antfu/utils': 0.7.6
'@rollup/pluginutils': 5.0.4 '@rollup/pluginutils': 5.0.4
'@vueuse/core': 10.6.1(vue@3.3.8) '@vueuse/core': 10.6.1(vue@3.3.10)
fast-glob: 3.3.1 fast-glob: 3.3.1
local-pkg: 0.4.3 local-pkg: 0.4.3
magic-string: 0.30.5 magic-string: 0.30.5
@ -7405,7 +7494,7 @@ packages:
- rollup - rollup
dev: true dev: true
/unplugin-vue-components@0.25.2(vue@3.3.8): /unplugin-vue-components@0.25.2(vue@3.3.10):
resolution: {integrity: sha512-OVmLFqILH6w+eM8fyt/d/eoJT9A6WO51NZLf1vC5c1FZ4rmq2bbGxTy8WP2Jm7xwFdukaIdv819+UI7RClPyCA==} resolution: {integrity: sha512-OVmLFqILH6w+eM8fyt/d/eoJT9A6WO51NZLf1vC5c1FZ4rmq2bbGxTy8WP2Jm7xwFdukaIdv819+UI7RClPyCA==}
engines: {node: '>=14'} engines: {node: '>=14'}
peerDependencies: peerDependencies:
@ -7428,7 +7517,7 @@ packages:
minimatch: 9.0.3 minimatch: 9.0.3
resolve: 1.22.5 resolve: 1.22.5
unplugin: 1.4.0 unplugin: 1.4.0
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
transitivePeerDependencies: transitivePeerDependencies:
- rollup - rollup
- supports-color - supports-color
@ -7508,13 +7597,13 @@ packages:
engines: {node: '>= 0.8'} engines: {node: '>= 0.8'}
dev: true dev: true
/vdirs@0.1.8(vue@3.3.8): /vdirs@0.1.8(vue@3.3.10):
resolution: {integrity: sha512-H9V1zGRLQZg9b+GdMk8MXDN2Lva0zx72MPahDKc30v+DtwKjfyOSXWRIX4t2mhDubM1H09gPhWeth/BJWPHGUw==} resolution: {integrity: sha512-H9V1zGRLQZg9b+GdMk8MXDN2Lva0zx72MPahDKc30v+DtwKjfyOSXWRIX4t2mhDubM1H09gPhWeth/BJWPHGUw==}
peerDependencies: peerDependencies:
vue: ^3.0.11 vue: ^3.0.11
dependencies: dependencies:
evtd: 0.2.4 evtd: 0.2.4
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
dev: false dev: false
/vite-plugin-cdn2@0.15.2: /vite-plugin-cdn2@0.15.2:
@ -7697,16 +7786,16 @@ packages:
fsevents: 2.3.3 fsevents: 2.3.3
dev: true dev: true
/vooks@0.2.12(vue@3.3.8): /vooks@0.2.12(vue@3.3.10):
resolution: {integrity: sha512-iox0I3RZzxtKlcgYaStQYKEzWWGAduMmq+jS7OrNdQo1FgGfPMubGL3uGHOU9n97NIvfFDBGnpSvkWyb/NSn/Q==} resolution: {integrity: sha512-iox0I3RZzxtKlcgYaStQYKEzWWGAduMmq+jS7OrNdQo1FgGfPMubGL3uGHOU9n97NIvfFDBGnpSvkWyb/NSn/Q==}
peerDependencies: peerDependencies:
vue: ^3.0.0 vue: ^3.0.0
dependencies: dependencies:
evtd: 0.2.4 evtd: 0.2.4
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
dev: false dev: false
/vue-demi@0.14.6(vue@3.3.8): /vue-demi@0.14.6(vue@3.3.10):
resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==}
engines: {node: '>=12'} engines: {node: '>=12'}
hasBin: true hasBin: true
@ -7718,7 +7807,7 @@ packages:
'@vue/composition-api': '@vue/composition-api':
optional: true optional: true
dependencies: dependencies:
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
/vue-eslint-parser@9.3.1(eslint@8.52.0): /vue-eslint-parser@9.3.1(eslint@8.52.0):
resolution: {integrity: sha512-Clr85iD2XFZ3lJ52/ppmUDG/spxQu6+MAeHXjjyI4I1NUYZ9xmenQp4N0oaHJhrA8OOxltCVxMRfANGa70vU0g==} resolution: {integrity: sha512-Clr85iD2XFZ3lJ52/ppmUDG/spxQu6+MAeHXjjyI4I1NUYZ9xmenQp4N0oaHJhrA8OOxltCVxMRfANGa70vU0g==}
@ -7738,7 +7827,7 @@ packages:
- supports-color - supports-color
dev: true dev: true
/vue-hooks-plus@1.8.5(vue@3.3.8): /vue-hooks-plus@1.8.5(vue@3.3.10):
resolution: {integrity: sha512-cIatTWz6QQcoSCDn7jadQ3zMr799FmNiHyb59yUvR7Ws5KDJ/KdIMHHx/b0XDKzbGhQ61kcJ78zJKAKhOV0pWw==} resolution: {integrity: sha512-cIatTWz6QQcoSCDn7jadQ3zMr799FmNiHyb59yUvR7Ws5KDJ/KdIMHHx/b0XDKzbGhQ61kcJ78zJKAKhOV0pWw==}
peerDependencies: peerDependencies:
vue: ^3.2.25 vue: ^3.2.25
@ -7750,9 +7839,9 @@ packages:
qs: 6.11.2 qs: 6.11.2
query-string: 7.1.3 query-string: 7.1.3
screenfull: 5.2.0 screenfull: 5.2.0
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
/vue-i18n@9.7.1(vue@3.3.8): /vue-i18n@9.7.1(vue@3.3.10):
resolution: {integrity: sha512-A6DzWqJQMdzBj+392+g3zIgGV0FnFC7o/V+txs5yIALANEZzY6ZV8hM2wvZR3nTbQI7dntAmzBHMeoEteJO0kQ==} resolution: {integrity: sha512-A6DzWqJQMdzBj+392+g3zIgGV0FnFC7o/V+txs5yIALANEZzY6ZV8hM2wvZR3nTbQI7dntAmzBHMeoEteJO0kQ==}
engines: {node: '>= 16'} engines: {node: '>= 16'}
peerDependencies: peerDependencies:
@ -7761,15 +7850,15 @@ packages:
'@intlify/core-base': 9.7.1 '@intlify/core-base': 9.7.1
'@intlify/shared': 9.7.1 '@intlify/shared': 9.7.1
'@vue/devtools-api': 6.5.1 '@vue/devtools-api': 6.5.1
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
/vue-router@4.2.4(vue@3.3.8): /vue-router@4.2.4(vue@3.3.10):
resolution: {integrity: sha512-9PISkmaCO02OzPVOMq2w82ilty6+xJmQrarYZDkjZBfl4RvYAlt4PKnEX21oW4KTtWfa9OuO/b3qk1Od3AEdCQ==} resolution: {integrity: sha512-9PISkmaCO02OzPVOMq2w82ilty6+xJmQrarYZDkjZBfl4RvYAlt4PKnEX21oW4KTtWfa9OuO/b3qk1Od3AEdCQ==}
peerDependencies: peerDependencies:
vue: ^3.2.0 vue: ^3.2.0
dependencies: dependencies:
'@vue/devtools-api': 6.5.1 '@vue/devtools-api': 6.5.1
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
dev: false dev: false
/vue-template-compiler@2.7.14: /vue-template-compiler@2.7.14:
@ -7791,34 +7880,34 @@ packages:
typescript: 5.2.2 typescript: 5.2.2
dev: true dev: true
/vue@3.3.8(typescript@5.2.2): /vue@3.3.10(typescript@5.2.2):
resolution: {integrity: sha512-5VSX/3DabBikOXMsxzlW8JyfeLKlG9mzqnWgLQLty88vdZL7ZJgrdgBOmrArwxiLtmS+lNNpPcBYqrhE6TQW5w==} resolution: {integrity: sha512-zg6SIXZdTBwiqCw/1p+m04VyHjLfwtjwz8N57sPaBhEex31ND0RYECVOC1YrRwMRmxFf5T1dabl6SGUbMKKuVw==}
peerDependencies: peerDependencies:
typescript: '*' typescript: '*'
peerDependenciesMeta: peerDependenciesMeta:
typescript: typescript:
optional: true optional: true
dependencies: dependencies:
'@vue/compiler-dom': 3.3.8 '@vue/compiler-dom': 3.3.10
'@vue/compiler-sfc': 3.3.8 '@vue/compiler-sfc': 3.3.10
'@vue/runtime-dom': 3.3.8 '@vue/runtime-dom': 3.3.10
'@vue/server-renderer': 3.3.8(vue@3.3.8) '@vue/server-renderer': 3.3.10(vue@3.3.10)
'@vue/shared': 3.3.8 '@vue/shared': 3.3.10
typescript: 5.2.2 typescript: 5.2.2
/vueuc@0.4.51(vue@3.3.8): /vueuc@0.4.51(vue@3.3.10):
resolution: {integrity: sha512-pLiMChM4f+W8czlIClGvGBYo656lc2Y0/mXFSCydcSmnCR1izlKPGMgiYBGjbY9FDkFG8a2HEVz7t0DNzBWbDw==} resolution: {integrity: sha512-pLiMChM4f+W8czlIClGvGBYo656lc2Y0/mXFSCydcSmnCR1izlKPGMgiYBGjbY9FDkFG8a2HEVz7t0DNzBWbDw==}
peerDependencies: peerDependencies:
vue: ^3.0.11 vue: ^3.0.11
dependencies: dependencies:
'@css-render/vue3-ssr': 0.15.12(vue@3.3.8) '@css-render/vue3-ssr': 0.15.12(vue@3.3.10)
'@juggle/resize-observer': 3.4.0 '@juggle/resize-observer': 3.4.0
css-render: 0.15.12 css-render: 0.15.12
evtd: 0.2.4 evtd: 0.2.4
seemly: 0.3.6 seemly: 0.3.6
vdirs: 0.1.8(vue@3.3.8) vdirs: 0.1.8(vue@3.3.10)
vooks: 0.2.12(vue@3.3.8) vooks: 0.2.12(vue@3.3.10)
vue: 3.3.8(typescript@5.2.2) vue: 3.3.10(typescript@5.2.2)
dev: false dev: false
/webidl-conversions@3.0.1: /webidl-conversions@3.0.1:

View File

@ -118,7 +118,7 @@ export const APP_CATCH_KEY = {
* 具体配置信息查看官网: https://www.naiveui.com/zh-CN/dark/components/watermark#API * 具体配置信息查看官网: https://www.naiveui.com/zh-CN/dark/components/watermark#API
*/ */
export const APP_WATERMARK_CONFIG = { export const APP_WATERMARK_CONFIG = {
content: 'Tring be better~', content: 'Trying be better~',
fontSize: 16, fontSize: 16,
lineHeight: 16, lineHeight: 16,
width: 384, width: 384,

View File

@ -11,13 +11,10 @@
import { setVariable, getVariableToRefs } from '@/global-variable' import { setVariable, getVariableToRefs } from '@/global-variable'
import { LAYOUT_CONTENT_REF } from '@/app-config/routerConfig' import { LAYOUT_CONTENT_REF } from '@/app-config/routerConfig'
import { addStyle, removeStyle } from '@/utils/element'
import { unrefElement } from '@/utils/vue' import { unrefElement } from '@/utils/vue'
import { useWindowSize } from '@vueuse/core' import { useElementFullscreen } from '../web'
export interface MaximizeOptions { import type { UseElementFullscreenOptions } from '../web'
zIndex?: string
}
export const useMaximize = () => { export const useMaximize = () => {
/** /**
@ -40,38 +37,15 @@ export const useMaximize = () => {
* LayoutContent layoutContentMaximize * LayoutContent layoutContentMaximize
* *
* @example * @example
* maximize(true, { MaximizeOptions }) * maximize(true, { UseElementFullscreenOptions })
* maximize(false, { MaximizeOptions }) * maximize(false, { UseElementFullscreenOptions })
*/ */
const maximize = (full: boolean, options?: MaximizeOptions) => { const maximize = (full: boolean, options?: UseElementFullscreenOptions) => {
const contentEl = unrefElement(LAYOUT_CONTENT_REF as Ref<HTMLElement>) const contentEl = unrefElement(LAYOUT_CONTENT_REF as Ref<HTMLElement>)
const { toggleFullscreen } = useElementFullscreen(contentEl, options)
if (contentEl) {
const { left, top } = contentEl.getBoundingClientRect() // 使用 left, top 计算 translate 偏移
const { height } = useWindowSize() // 获取实际高度避免 100vh 会导致手机端浏览器获取不准确问题
const { zIndex = '99' } = options ?? {}
full
? addStyle(contentEl, {
position: 'fixed',
width: '100%',
height: `${height.value}px`,
transform: `translate(-${left}px, -${top}px)`,
transition: 'all 0.3s var(--r-bezier)',
zIndex,
})
: removeStyle(contentEl, [
'position',
'width',
'height',
'transform',
// 为了兼容浏览器 zIndex 的样式表
'zIndex',
'z-index',
])
}
setVariable('layoutContentMaximize', full) setVariable('layoutContentMaximize', full)
toggleFullscreen()
} }
return { return {

View File

@ -13,3 +13,4 @@ export * from './useI18n'
export * from './useVueRouter' export * from './useVueRouter'
export * from './useDayjs' export * from './useDayjs'
export * from './useDevice' export * from './useDevice'
export * from './useElementFullscreen'

View File

@ -0,0 +1,162 @@
/**
*
* @author Ray <https://github.com/XiaoDaiGua-Ray>
*
* @date 2023-12-04
*
* @workspace ray-template
*
* @remark
*/
import { unrefElement, effectDispose } from '@/utils/vue'
import { useWindowSize } from '@vueuse/core'
import { isValueType } from '@/utils/basic'
import type { BasicTarget } from '@/types/modules/vue'
export interface UseElementFullscreenOptions {
beforeEnter?: () => void
beforeExit?: () => void
zIndex?: number
backgroundColor?: string
}
let currentZIndex = 999
let isAppend = false
const ID_TAG = 'ELEMENT-FULLSCREEN-RAY'
const { height } = useWindowSize() // 获取实际高度避免 100vh 会导致手机端浏览器获取不准确问题
const styleElement = document.createElement('style')
/**
*
* @param target target dom
* @param options useElementFullscreen options
*
* 使 API使 css
* transition
*
* positionz-indextransitiontransformwidthheight
*
* @example
* <template>
* <div ref="refDom" />
* </template>
* <script lang="ts" setup>
* const refDom = ref<HTMLElement>()
* const { enter, exit, toggleFullscreen } = useElementFullscreen(refDom, { UseElementFullscreenOptions })
*
* enter() // 进入全屏
* exit() // 退出全屏
* toggleFullscreen() // 切换全屏
* </script>
*/
export const useElementFullscreen = (
target: BasicTarget,
options?: UseElementFullscreenOptions,
) => {
const { beforeEnter, beforeExit, backgroundColor, zIndex } = options ?? {}
const cacheStyle: Partial<CSSStyleDeclaration> = {} // 缓存一些需要被覆盖的样式,例如: transition
let isSetup = false
const updateStyle = () => {
const element = unrefElement(target) as HTMLElement | null
if (!element) {
return
}
const { left, top } = element.getBoundingClientRect()
const cssContent = `
[${ID_TAG}] {
position: fixed;
width: 100% !important;
height: ${height.value}px !important;
transform: translate(-${left}px, -${top}px) !important;
transition: all 0.3s var(--r-bezier);
z-index: ${
isValueType<null>(zIndex, 'Null') ||
isValueType<undefined>(zIndex, 'Undefined')
? currentZIndex
: zIndex
} !important;
background-color: ${backgroundColor ?? null};
}
`
styleElement.innerHTML = cssContent
// 避免重复添加 style 标签
if (!isAppend) {
document.head.appendChild(styleElement)
}
}
const enter = () => {
const element = unrefElement(target) as HTMLElement | null
beforeEnter?.()
if (element) {
if (!element.getAttribute(ID_TAG)) {
element.setAttribute(ID_TAG, ID_TAG)
}
if (!isSetup) {
isSetup = true
currentZIndex += 1
}
if (!isAppend) {
updateStyle()
isAppend = true
}
cacheStyle.transition = element.style.transition
element.style.transition = 'all 0.3s var(--r-bezier)'
}
}
const exit = () => {
beforeExit?.()
const element = unrefElement(target)
if (element) {
element.removeAttribute(ID_TAG)
}
}
const toggleFullscreen = () => {
const element = unrefElement(target)
if (element) {
if (element.getAttribute(ID_TAG)) {
exit()
} else {
enter()
}
}
}
const stopWatch = watch(() => height.value, updateStyle)
effectDispose(() => {
const element = unrefElement(target) as HTMLElement | null
if (element) {
element.style.transition = cacheStyle.transition ?? ''
element.removeAttribute(ID_TAG)
}
stopWatch()
})
return {
enter,
exit,
toggleFullscreen,
}
}

View File

@ -42,6 +42,7 @@ import { useKeepAliveActions } from '@/store'
import type { AppRouteRecordRaw } from '@/router/type' import type { AppRouteRecordRaw } from '@/router/type'
import type { AppMenuOption, MenuTagOptions } from '@/types/modules/app' import type { AppMenuOption, MenuTagOptions } from '@/types/modules/app'
import type { MenuState } from '@/store/modules/menu/type' import type { MenuState } from '@/store/modules/menu/type'
import type { LocationQuery } from 'vue-router'
export const piniaMenuStore = defineStore( export const piniaMenuStore = defineStore(
'menu', 'menu',
@ -144,6 +145,7 @@ export const piniaMenuStore = defineStore(
const changeMenuModelValue = ( const changeMenuModelValue = (
key: string | number, key: string | number,
option: AppMenuOption, option: AppMenuOption,
query?: LocationQuery,
) => { ) => {
const { meta, path } = option const { meta, path } = option
@ -163,10 +165,16 @@ export const piniaMenuStore = defineStore(
.map((curr) => curr.key) .map((curr) => curr.key)
.join('/') .join('/')
router.push(_path) router.push({
path: _path,
query,
})
} else { } else {
/** 根路由直接跳转 */ /** 根路由直接跳转 */
router.push(path) router.push({
path,
query,
})
} }
/** 检查是否为根路由 */ /** 检查是否为根路由 */
@ -201,14 +209,18 @@ export const piniaMenuStore = defineStore(
* @remark * @remark
* @remark * @remark
*/ */
const updateMenuKeyWhenRouteUpdate = async (path: string) => { const updateMenuKeyWhenRouteUpdate = async (
// 获取 `/` 出现次数(如果为 1 则表示该路径为根路由路径) path: string,
const count = (path.match(new RegExp('/', 'g')) || []).length query: LocationQuery,
let combinePath = path ) => {
const [routePath] = path.split('?')
const count = (routePath.match(new RegExp('/', 'g')) || []).length // 如果获取长度为 1则视为根路由
let combinePath = routePath
if (count > 1) { if (count > 1) {
// 如果不是跟路径则取出最后一项字符 // 如果不是跟路径则取出最后一项字符
const splitPath = path.split('/').filter((curr) => curr) const splitPath = routePath.split('/').filter((curr) => curr)
combinePath = splitPath[splitPath.length - 1] combinePath = splitPath[splitPath.length - 1]
} }
@ -217,10 +229,12 @@ export const piniaMenuStore = defineStore(
for (const curr of options) { for (const curr of options) {
if (curr.children?.length) { if (curr.children?.length) {
findMenuOption(pathKey, curr.children) findMenuOption(pathKey, curr.children)
continue
} }
if (pathKey === curr.key && !curr?.children?.length) { if (pathKey === curr.key && !curr?.children?.length) {
changeMenuModelValue(pathKey, curr) changeMenuModelValue(pathKey, curr, query)
break break
} }
@ -331,22 +345,24 @@ export const piniaMenuStore = defineStore(
* *
*/ */
const setupPiniaMenuStore = async () => { const setupPiniaMenuStore = async () => {
if (isSetupAppMenuLock.value) { if (!isSetupAppMenuLock.value) {
await setupAppMenu() return
} }
await setupAppMenu()
isSetupAppMenuLock.value = false isSetupAppMenuLock.value = false
} }
/** 监听路由变化并且更新路由菜单与菜单标签 */ /** 监听路由变化并且更新路由菜单与菜单标签 */
watch( watch(
() => route.fullPath, () => route.fullPath,
async (newData) => { async (ndata, odata) => {
const reg = /^([^?]+)/
const match = newData.match(reg)?.[1]
await setupPiniaMenuStore() await setupPiniaMenuStore()
await updateMenuKeyWhenRouteUpdate(match || '')
if (ndata !== odata) {
await updateMenuKeyWhenRouteUpdate(ndata, route.query)
}
}, },
{ {
immediate: true, immediate: true,

View File

@ -232,12 +232,15 @@ export const removeStyle = (
* *
* @param color * @param color
* @param alpha * @param alpha
* @returns rgba
* *
* @remark rgba * rgba rgba, rgb
* *
* @example * @example
* colorToRgba('#123632', 0.8) => rgba(18, 54, 50, 0.8) * colorToRgba('#123632', 0.8) => rgba(18, 54, 50, 0.8)
* colorToRgba('rgb(18, 54, 50)', 0.8) => rgb(18, 54, 50)
* colorToRgba('#ee4f12', 0.3) => rgba(238, 79, 18, 0.3)
* colorToRgba('rgba(238, 79, 18, 0.3)', 0.3) => rgba(238, 79, 18, 0.3)
* colorToRgba('not a color', 0.3) => not a color
*/ */
export const colorToRgba = (color: string, alpha = 1) => { export const colorToRgba = (color: string, alpha = 1) => {
const hexPattern = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i const hexPattern = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i
@ -257,11 +260,11 @@ export const colorToRgba = (color: string, alpha = 1) => {
result = 'rgb(' + rgb.join(', ') + ')' result = 'rgb(' + rgb.join(', ') + ')'
} else if (rgbPattern.test(color)) { } else if (rgbPattern.test(color)) {
result = color return color
} else if (rgbaPattern.test(color)) { } else if (rgbaPattern.test(color)) {
result = color return color
} else { } else {
result = color return color
} }
if (result && !result.startsWith('rgba')) { if (result && !result.startsWith('rgba')) {

View File

@ -28,12 +28,12 @@ import type { ComponentPublicInstance } from 'vue'
* unrefElement(refDom) => div * unrefElement(refDom) => div
* unrefElement(computedDom) => div * unrefElement(computedDom) => div
*/ */
export function unrefElement<T extends TargetType>( function unrefElement<T extends TargetType>(
target: BasicTarget<T>, target: BasicTarget<T>,
defaultTarget?: T, defaultElement?: T,
) { ) {
if (!target) { if (!target) {
return defaultTarget return defaultElement
} }
let targetElement: TargetValue<T> let targetElement: TargetValue<T>
@ -49,3 +49,5 @@ export function unrefElement<T extends TargetType>(
return targetElement return targetElement
} }
export { unrefElement }

View File

@ -21,6 +21,12 @@ import type { AnyFC } from '@/types/modules/utils'
* *
* 使 watchEffect * 使 watchEffect
* effect * effect
*
* @example
* const ref = ref(0)
* const watcher = watch(()=> ref.value, (newVal, oldVal) => {})
*
* watchEffectWithTarget(watcher)
*/ */
export function watchEffectWithTarget<T extends AnyFC>( export function watchEffectWithTarget<T extends AnyFC>(
fc: T, fc: T,

View File

@ -14,6 +14,7 @@ import { NCard, NSpace } from 'naive-ui'
const RouterDemoDetail = defineComponent({ const RouterDemoDetail = defineComponent({
name: 'RouterDemoDetail', name: 'RouterDemoDetail',
render() { render() {
console.log(this.$route.query)
return ( return (
<NSpace wrapItem={false}> <NSpace wrapItem={false}>
<NCard title="平层路由详情页面"></NCard> <NCard title="平层路由详情页面"></NCard>

View File

@ -52,6 +52,9 @@ const RouterDemoHome = defineComponent({
onClick={() => { onClick={() => {
router.push({ router.push({
path: '/router-demo/router-demo-detail', path: '/router-demo/router-demo-detail',
query: {
name: '23',
},
}) })
}} }}
> >

View File

@ -33,7 +33,7 @@ import config from './cfg'
import type { PluginOption } from 'vite' import type { PluginOption } from 'vite'
// 仅适用于报告模式 // 仅适用于报告模式report
function onlyReportOptions(mode: string) { function onlyReportOptions(mode: string) {
return [ return [
visualizer({ visualizer({