From 558dece1afc4bf48f47528ed83a8cfd72eb00a38 Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期四, 06 六月 2024 14:49:00 +0800 Subject: [PATCH] chore:修改路由 --- src/views/menu/index.vue | 25 +++++++++++++------------ 1 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/views/menu/index.vue b/src/views/menu/index.vue index 2cadedf..4ff1669 100644 --- a/src/views/menu/index.vue +++ b/src/views/menu/index.vue @@ -6,7 +6,7 @@ </el-row> <el-row :gutter="20" class="mb-2"> <el-col :span="3" v-for="item in menu.categroy"> - <div class="menu-item cursor-pointer" @click="testClick(item)"> + <div class="menu-item cursor-pointer" @click="menuClick(item)"> <el-card shadow="hover" class="menu-card"> <div class="item-icon mx-auto"> <img :src="item.iconPath" class="icon-img" alt=""> @@ -35,11 +35,8 @@ categroy: [ { title: '鎴戠殑璇剧▼', - iconPath: new URL('@/assets/icons/icon1.png', import.meta.url).href - }, - { - title: '鎴戠殑鑰冭瘯', - iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href + iconPath: new URL('@/assets/icons/icon1.png', import.meta.url).href, + path: '/exam-list' }, ] }, @@ -47,19 +44,23 @@ name: '鑰冭瘯', categroy: [ { - title: '鎴戠殑璇剧▼', - iconPath: new URL('@/assets/icons/icon1.png', import.meta.url).href + title: '鎴戠殑鑰冭瘯', + iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href, + path: '/exam-list' }, { - title: '鎴戠殑鑰冭瘯', - iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href + title: '鎴戠殑鎴愮哗', + iconPath: new URL('@/assets/icons/icon1.png', import.meta.url).href, + path: '/grade-list' }, ] }, ]); -const testClick = (item) => { - router.push('/exam-list'); +const menuClick = (item) => { + if(item.path) { + router.push(item.path); + } } </script> -- Gitblit v1.8.0