From d1bb736973b98b16d73ccecc3b7c285f72e41cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=AE=E6=A2=A6?= Date: Wed, 23 Aug 2023 13:12:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E8=B7=B3=E8=BD=AC=E6=90=BA=E5=B8=A6=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E6=94=B9=E4=B8=BAparams?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/modules/remaining.ts | 2 +- src/views/member/user/detail/index.vue | 4 +--- src/views/member/user/index.vue | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 2d8e2b44..602fbb58 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -434,7 +434,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ meta: { hidden: true }, children: [ { - path: 'user/detail', + path: 'user/detail/:member_id', name: 'MemberUserDetail', meta: { title: '会员详情', diff --git a/src/views/member/user/detail/index.vue b/src/views/member/user/detail/index.vue index c77934d1..38c8712c 100644 --- a/src/views/member/user/detail/index.vue +++ b/src/views/member/user/detail/index.vue @@ -200,9 +200,7 @@ const openForm = (type: string, id?: number) => { /** 初始化 */ const route = useRoute() const router = useRouter() -// TODO @梦:改成 id 路径参数,而不是 query -// TODO @梦:会员列表,把【详情】按钮加上哈 -const member_id = route.query.member_id as number +const member_id = route.params.member_id as number onMounted(() => { if (!member_id) { // TODO diff --git a/src/views/member/user/index.vue b/src/views/member/user/index.vue index 777fa8d5..0cadf5d1 100644 --- a/src/views/member/user/index.vue +++ b/src/views/member/user/index.vue @@ -183,7 +183,7 @@ const resetQuery = () => { const { push } = useRouter() const goMemberDetail = (id: number) => { - push({ path: 'user/detail', query: { member_id: id } }) + push({ name: 'MemberUserDetail', params: { member_id: id } }) } /** 初始化 **/