From 57f8559020c02330585bf7ba110e1310498fd889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E9=B9=8F?= <2916022834@qq.com> Date: Fri, 29 May 2026 10:04:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E5=8E=BB=E6=8E=89=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/down-menu.vue | 22 +++++++-- src/components/main-header.vue | 9 ++-- src/components/main-menu-dialog.vue | 4 +- src/routes.ts | 74 ++++++++++++++--------------- 4 files changed, 64 insertions(+), 45 deletions(-) diff --git a/src/components/down-menu.vue b/src/components/down-menu.vue index 43d3104..1ec1c25 100644 --- a/src/components/down-menu.vue +++ b/src/components/down-menu.vue @@ -4,7 +4,7 @@ {{ title }} -
+
@@ -16,6 +16,10 @@ title: { type: String, default: '' + }, + position: { + type: String as () => 'left' | 'right' | 'center', + default: 'left' } }) @@ -69,7 +73,8 @@ background-color: #fff; display: flex; flex-direction: column; - transform: translateY(calc(100% + 5px)); + --translate-x: 0; + transform: translate(var(--translate-x), calc(100% + 5px)); > * { display: inline-block; padding: 10px 15px; @@ -81,6 +86,17 @@ opacity: 0.5; } } + left: 0; + right: auto; + &.right { + left: auto; + right: 0; + } + &.center { + left: 50%; + right: auto; + --translate-x: -50%; + } } &:hover > .child { animation: child-show 0.2s linear both; @@ -92,7 +108,7 @@ } 100% { // opacity: 1; - transform: translateY(100%); + transform: translate(var(--translate-x), 100%); visibility: visible; } } diff --git a/src/components/main-header.vue b/src/components/main-header.vue index 58435a9..daa435f 100644 --- a/src/components/main-header.vue +++ b/src/components/main-header.vue @@ -14,7 +14,10 @@
- + - +
diff --git a/src/components/main-menu-dialog.vue b/src/components/main-menu-dialog.vue index 66bdbee..8abafdd 100644 --- a/src/components/main-menu-dialog.vue +++ b/src/components/main-menu-dialog.vue @@ -25,11 +25,11 @@
- +
import('./pages/help-centre/index.vue') }, - { - path: 'my-account', - name: 'MyAccount', - component: () => import('./pages/my-account/index.vue'), - children: [ - { - path: '', - name: 'welcome', - component: () => import('./pages/my-account/welcome.vue'), - }, - { - path: 'orders', - name: 'orders', - component: () => import('./pages/my-account/orders.vue'), - }, - { - path: 'subscriptions', - name: 'subscriptions', - component: () => import('./pages/my-account/subscriptions.vue'), - }, - { - path: 'address', - name: 'address', - component: () => import('./pages/my-account/address.vue'), - }, - { - path: 'payment-methods', - name: 'payment-methods', - component: () => import('./pages/my-account/payment-methods.vue'), - }, - { - path: ':pathMatch(.*)*', - name: 'not-found-welcome', - component: () => import('./pages/my-account/welcome.vue'), - }, - ] - }, + // { + // path: 'my-account', + // name: 'MyAccount', + // component: () => import('./pages/my-account/index.vue'), + // children: [ + // { + // path: '', + // name: 'welcome', + // component: () => import('./pages/my-account/welcome.vue'), + // }, + // { + // path: 'orders', + // name: 'orders', + // component: () => import('./pages/my-account/orders.vue'), + // }, + // { + // path: 'subscriptions', + // name: 'subscriptions', + // component: () => import('./pages/my-account/subscriptions.vue'), + // }, + // { + // path: 'address', + // name: 'address', + // component: () => import('./pages/my-account/address.vue'), + // }, + // { + // path: 'payment-methods', + // name: 'payment-methods', + // component: () => import('./pages/my-account/payment-methods.vue'), + // }, + // { + // path: ':pathMatch(.*)*', + // name: 'not-found-welcome', + // component: () => import('./pages/my-account/welcome.vue'), + // }, + // ] + // }, { path: 'privacy-policy', name: 'privacy-policy', component: () => import('./pages/others/privacy-policy.vue')