From 8d248a44ff1b9d8571d91552a6a1455bea83af47 Mon Sep 17 00:00:00 2001 From: UnknownMp Date: Fri, 23 May 2025 22:41:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AE=E6=9D=BF?= =?UTF-8?q?=E5=9D=97,=20=E5=85=81=E8=AE=B8=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=AE=BE=E7=BD=AE,=20=E4=BD=BF=E7=94=A8=20Vu?= =?UTF-8?q?eUse=20=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [Style] 为主视图增加 16px 间距 更新 mdui-card 的右边距问题 (老问题了, 还是没有解决) [Base] 引入 VueUse 分离 Axios HTML 部分紧凑化 --- package-lock.json | 107 ++++++++++++++++++++++++++++++ package.json | 2 + src/App.vue | 41 ++++++------ src/composables/apiRequest.js | 56 ++++++++++++++++ src/main.scss | 2 +- src/router.js | 10 ++- src/stores/api.js | 118 ++++------------------------------ src/stores/appSetting.js | 28 ++++++++ src/stores/themeScheme.js | 15 +++-- src/views/Settings.vue | 40 ++++++++++++ src/views/Work.vue | 6 +- 11 files changed, 287 insertions(+), 138 deletions(-) create mode 100644 src/composables/apiRequest.js create mode 100644 src/stores/appSetting.js create mode 100644 src/views/Settings.vue diff --git a/package-lock.json b/package-lock.json index a92fa54..9265a43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "0.0.0", "dependencies": { "@mdui/icons": "^1.0.2", + "@vueuse/core": "^13.2.0", + "@vueuse/integrations": "^13.2.0", "axios": "^1.9.0", "compress-json": "^3.1.1", "cookie-parser": "^1.4.7", @@ -1731,6 +1733,11 @@ "resolved": "https://registry.npmmirror.com/@types/trusted-types/-/trusted-types-2.0.7.tgz", "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==" }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.21", + "resolved": "https://registry.npmmirror.com/@types/web-bluetooth/-/web-bluetooth-0.0.21.tgz", + "integrity": "sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==" + }, "node_modules/@vitejs/plugin-vue": { "version": "5.2.4", "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz", @@ -1963,6 +1970,106 @@ "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.13.tgz", "integrity": "sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==" }, + "node_modules/@vueuse/core": { + "version": "13.2.0", + "resolved": "https://registry.npmmirror.com/@vueuse/core/-/core-13.2.0.tgz", + "integrity": "sha512-n5TZoIAxbWAQ3PqdVPDzLgIRQOujFfMlatdI+f7ditSmoEeNpPBvp7h2zamzikCmrhFIePAwdEQB6ENccHr7Rg==", + "dependencies": { + "@types/web-bluetooth": "^0.0.21", + "@vueuse/metadata": "13.2.0", + "@vueuse/shared": "13.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/@vueuse/integrations": { + "version": "13.2.0", + "resolved": "https://registry.npmmirror.com/@vueuse/integrations/-/integrations-13.2.0.tgz", + "integrity": "sha512-tnwdzUYadAiewvMtBcjH/ZPgRCoQBvuVzbFA/VSysPDaIuG41Jp/Z1Sn/rYoFMOLJfcOEcVh+tN3mkrVIyumig==", + "dependencies": { + "@vueuse/core": "13.2.0", + "@vueuse/shared": "13.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "async-validator": "^4", + "axios": "^1", + "change-case": "^5", + "drauu": "^0.4", + "focus-trap": "^7", + "fuse.js": "^7", + "idb-keyval": "^6", + "jwt-decode": "^4", + "nprogress": "^0.2", + "qrcode": "^1.5", + "sortablejs": "^1", + "universal-cookie": "^7", + "vue": "^3.5.0" + }, + "peerDependenciesMeta": { + "async-validator": { + "optional": true + }, + "axios": { + "optional": true + }, + "change-case": { + "optional": true + }, + "drauu": { + "optional": true + }, + "focus-trap": { + "optional": true + }, + "fuse.js": { + "optional": true + }, + "idb-keyval": { + "optional": true + }, + "jwt-decode": { + "optional": true + }, + "nprogress": { + "optional": true + }, + "qrcode": { + "optional": true + }, + "sortablejs": { + "optional": true + }, + "universal-cookie": { + "optional": true + } + } + }, + "node_modules/@vueuse/metadata": { + "version": "13.2.0", + "resolved": "https://registry.npmmirror.com/@vueuse/metadata/-/metadata-13.2.0.tgz", + "integrity": "sha512-kPpzuQCU0+D8DZCzK0iPpIcXI+6ufWSgwnjJ6//GNpEn+SHViaCtR+XurzORChSgvpHO9YC8gGM97Y1kB+UabA==", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "13.2.0", + "resolved": "https://registry.npmmirror.com/@vueuse/shared/-/shared-13.2.0.tgz", + "integrity": "sha512-vx9ZPDF5HcU9up3Jgt3G62dMUfZEdk6tLyBAHYAG4F4n73vpaA7J5hdncDI/lS9Vm7GA/FPlbOmh9TrDZROTpg==", + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, "node_modules/@yankeeinlondon/builder-api": { "version": "1.4.1", "resolved": "https://registry.npmmirror.com/@yankeeinlondon/builder-api/-/builder-api-1.4.1.tgz", diff --git a/package.json b/package.json index 1d160ff..4dfcaa4 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,8 @@ }, "dependencies": { "@mdui/icons": "^1.0.2", + "@vueuse/core": "^13.2.0", + "@vueuse/integrations": "^13.2.0", "axios": "^1.9.0", "compress-json": "^3.1.1", "cookie-parser": "^1.4.7", diff --git a/src/App.vue b/src/App.vue index c07f124..7af591c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -27,7 +27,7 @@ const route = useRoute() const clientOnlyStore = useClientOnlyStore() const api = useApiStore() -const themeScheme = useThemeStore() +let themeScheme = null const mobileScreen = useMobileScreen() const routeStore = useRouteStore() @@ -38,7 +38,7 @@ const closeDrawer = ref(true) let progressTimer = null onServerPrefetch(async () => { - await api.init() + }) onBeforeMount(() => { @@ -47,8 +47,8 @@ onBeforeMount(() => { }) onMounted(async () => { + themeScheme = useThemeStore() themeScheme.applyTheme() - await api.init() clientOnlyStore.setClient() new MutationObserver(() => { if (document.documentElement.style.width.includes('calc')) { @@ -63,8 +63,8 @@ onMounted(async () => { +
- - -
- + + +
diff --git a/src/views/Work.vue b/src/views/Work.vue index 1cb0802..9fb331d 100644 --- a/src/views/Work.vue +++ b/src/views/Work.vue @@ -148,9 +148,9 @@ onBeforeUnmount(() => {


-
+

{{ para }}

-
+ @@ -199,7 +199,7 @@ onBeforeUnmount(() => {


-

{{ para }}

+

{{ para }}