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 = () => {