From 83bdad0800d692f657b4f4863877a7540f5e7e52 Mon Sep 17 00:00:00 2001 From: Yunfei Du <278774021@qq.com> Date: Thu, 28 Mar 2024 16:25:21 +0800 Subject: [PATCH] zxj --- src/router/index.js | 2 +- src/views/product/info/index.vue | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index 182d438..882458e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -80,7 +80,7 @@ export const constantRoutes = [ redirect: 'product-detail', children: [ { - path: 'product-detail', + path: 'product-detail/:id', component: () => import('@/views/product/info/detail/index'), name: 'Demo', meta: {title: '商品详情', icon: 'dashboard', affix: true} diff --git a/src/views/product/info/index.vue b/src/views/product/info/index.vue index 1346ecd..7d5c2f1 100644 --- a/src/views/product/info/index.vue +++ b/src/views/product/info/index.vue @@ -129,6 +129,12 @@ @click="handleDelete(scope.row)" v-hasPermi="['product:info:remove']" >删除 + 查看详细信息 @@ -773,6 +779,15 @@ export default { } }); }, + /** 查询详细信息 */ + handleDetail(id){ + // this.$router.push 是在 SPA 中使用的,不会刷新页面,只会动态地加载或卸载组件 + this.$router.push("/product-detail/"+id) + + // window.open 会打开一个新的浏览器窗口或标签页,并加载一个全新的页面,这会导致整个页面的刷新 + // let url = `${window.location.origin}/product-detail/${detailId}` + // window.open(url); + }, /** 删除按钮操作 */ handleDelete(row) { const ids = row.id || this.ids;