From 98f494cf633e3acf5c20f3e9de0d708f2a6c2045 Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期五, 05 七月 2024 09:39:59 +0800 Subject: [PATCH] feat:视频浏览 --- src/views/menu/index.vue | 32 +++++++++++++++++++------------- 1 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/views/menu/index.vue b/src/views/menu/index.vue index 2cadedf..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" @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=""> @@ -25,7 +25,7 @@ <script setup> import { ref } from 'vue'; -import {useRouter} from 'vue-router'; +import { useRouter } from 'vue-router'; const router = useRouter(); @@ -34,12 +34,14 @@ 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' }, ] }, @@ -47,20 +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 testClick = (item) => { - router.push('/exam-list'); -} +const menuClick = (item) => { + if (item.path) { + router.push(item.path); + } +}; </script> <style lang="scss" scoped> -- Gitblit v1.8.0