From c00907127c2b2692e7c3cb9c0c1b9e3768c758ee Mon Sep 17 00:00:00 2001 From: expdsn <18111002318@163.com> Date: Thu, 21 Nov 2024 11:16:21 +0800 Subject: [PATCH] =?UTF-8?q?"=E4=BE=A7=E8=BE=B9=E6=A0=8F=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E7=9A=84=E6=A8=A1=E5=BC=8F=E6=98=AF=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E5=BD=93=E5=89=8D=E5=A4=84=E4=BA=8E=E5=93=AA=E4=B8=AA?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=8C=E9=82=A3=E4=B8=AA=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=B0=B1=E6=98=AF=E9=80=89=E4=B8=AD=E7=8A=B6=E6=80=81=20"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/GlobalMenu.tsx | 11 +++++++++-- src/layout/sider/ModeSwitch.tsx | 35 +++++++++++++++++++++++---------- src/layout/useLayoutStore.ts | 2 +- src/user/useUserStore.ts | 3 ++- 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/layout/GlobalMenu.tsx b/src/layout/GlobalMenu.tsx index 89a954f..43dd1bf 100644 --- a/src/layout/GlobalMenu.tsx +++ b/src/layout/GlobalMenu.tsx @@ -66,6 +66,10 @@ const Item = defineComponent({ noStyle: { type: Boolean, default: false + }, + centered: { + type: Boolean, + default: false } }, emits: { @@ -75,12 +79,13 @@ const Item = defineComponent({ return () => (
{ return ( <> { menu.showEditPage = true menu.dismiss() @@ -226,6 +232,7 @@ export default defineComponent(() => { {layout.state.content[layout.state.current].pages.length > 1 && ( { // 删除链接 diff --git a/src/layout/sider/ModeSwitch.tsx b/src/layout/sider/ModeSwitch.tsx index e1b9524..b8c8c83 100644 --- a/src/layout/sider/ModeSwitch.tsx +++ b/src/layout/sider/ModeSwitch.tsx @@ -17,11 +17,15 @@ export default defineComponent(() => { (val) => { selected.value = val hover.value = false - }, { immediate: true } ) - + watch( + () => selected.value, + (val) => { + console.log(val) + } + ) return () => (
{
@@ -75,7 +80,8 @@ export default defineComponent(() => {
@@ -86,7 +92,8 @@ export default defineComponent(() => { 'absolute text-white text-[13px] flex flex-col z-20 items-center pointer-events-none', settings.state.siderDirection === 'right' ? 'right-[105px] top-[140px]' - : 'left-[105px] top-[140px]' + : 'left-[105px] top-[140px]', + selected.value === 2 || layout.state.current === 2 ? ' opacity-100' : ' opacity-70' )} > @@ -116,7 +123,12 @@ export default defineComponent(() => { /> {/* 判定区块,无颜色 */} - + { + layout.state.current = selected.value + }} + > { { - layout.state.current = selected.value + onMouseenter={() => { + selected.value = layout.state.current + }} + onClick={()=> { + hover.value = false }} style="transform-origin: 50% 50%;" fill="url(#mode-switch-selected)" diff --git a/src/layout/useLayoutStore.ts b/src/layout/useLayoutStore.ts index aa69be5..2a837d1 100644 --- a/src/layout/useLayoutStore.ts +++ b/src/layout/useLayoutStore.ts @@ -132,7 +132,7 @@ export default defineStore('layout', () => { if (!res) return state.dir = res.dir state.content = res.content - + state.dock = res.dock }).catch(() => { Object.assign(state, defaultLayout) diff --git a/src/user/useUserStore.ts b/src/user/useUserStore.ts index a36e867..459a666 100644 --- a/src/user/useUserStore.ts +++ b/src/user/useUserStore.ts @@ -128,7 +128,8 @@ export default defineStore('user', () => { if (!remoteAddList.value) return console.log({ ...remoteAddList.value }) remoteAddList.value.map((item) => { - layout.state.content[layout.state.current].pages[layout.state.currentPage].list.push(item) + if (item.link) + layout.state.content[layout.state.current].pages[layout.state.currentPage].list.push(item) }) } const coverageData = () => {