From d2fc22d5f2b0f095b4c49c618ef03ae2f0f41b5d Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期一, 21 十月 2024 11:21:36 +0800
Subject: [PATCH] 江西空管发版
---
src/views/menu/index.vue | 35 +++++++++++++++++++++++------------
1 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/src/views/menu/index.vue b/src/views/menu/index.vue
index c9a2c10..31b6be8 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">
+ <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="">
@@ -25,18 +25,23 @@
<script setup>
import { ref } from 'vue';
+import { useRouter } from 'vue-router';
+
+const router = useRouter();
const menuList = ref([
{
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: '/train'
},
{
- 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: '/folder'
},
]
},
@@ -44,16 +49,24 @@
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 menuClick = (item) => {
+ if (item.path) {
+ router.push(item.path);
+ }
+};
</script>
<style lang="scss" scoped>
@@ -72,13 +85,11 @@
}
.item-icon {
- width: 90px;
- height: 90px;
+ width: 65%;
}
.icon-img {
width: 100%;
- height: 100%;
object-fit: cover;
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0