From 13fbbe8840e6d1e8550f92c101c62b3876c1a8a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= Date: Wed, 9 Sep 2026 16:09:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E5=81=8F?= =?UTF-8?q?=E5=A5=BD=E8=AE=BE=E7=BD=AE=E6=A8=A1=E5=9D=97=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=85=A8=E5=B1=80=E8=AE=BE=E7=BD=AE=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E4=B8=8E=E9=80=9A=E7=94=A8hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 抽离usePreferenceRows通用hook,统一管理偏好设置的字段定义、状态读写与交互逻辑 2. 新增全局操作组件与全局设置弹窗,替换原有的滚动到顶部组件 3. 重构页面端偏好设置页面,复用通用hook减少重复代码 4. 修复并优化了原有组件的页面适配逻辑 --- src/App.ku.vue | 56 ++-- src/App.vue | 1 + .../uh-glass-popup/uh-glass-popup.vue | 2 + .../uh-global-actions/uh-global-actions.vue | 10 + .../uh-scrolltop-button.vue} | 23 +- .../uh-settings-button/uh-settings-button.vue | 29 ++ .../uh-settings-popup/uh-settings-popup.vue | 222 ++++++++++++++ src/hooks/usePreferenceRows.ts | 185 ++++++++++++ src/hooks/useSettingsPopup.ts | 16 + src/pages-blog/setting/setting.vue | 276 +++++------------- 10 files changed, 574 insertions(+), 246 deletions(-) create mode 100644 src/components/uh-global-actions/uh-global-actions.vue rename src/components/{uh-scroll-top/uh-scroll-top.vue => uh-scrolltop-button/uh-scrolltop-button.vue} (61%) create mode 100644 src/components/uh-settings-button/uh-settings-button.vue create mode 100644 src/components/uh-settings-popup/uh-settings-popup.vue create mode 100644 src/hooks/usePreferenceRows.ts create mode 100644 src/hooks/useSettingsPopup.ts diff --git a/src/App.ku.vue b/src/App.ku.vue index b7975fb..83aa4d9 100644 --- a/src/App.ku.vue +++ b/src/App.ku.vue @@ -1,37 +1,33 @@ + + + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index a18ce98..6d7eff8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,3 +1,4 @@ + + + + diff --git a/src/components/uh-scroll-top/uh-scroll-top.vue b/src/components/uh-scrolltop-button/uh-scrolltop-button.vue similarity index 61% rename from src/components/uh-scroll-top/uh-scroll-top.vue rename to src/components/uh-scrolltop-button/uh-scrolltop-button.vue index 4d4e017..5f9048f 100644 --- a/src/components/uh-scroll-top/uh-scroll-top.vue +++ b/src/components/uh-scrolltop-button/uh-scrolltop-button.vue @@ -1,32 +1,39 @@