From 4c607a400b6382bfdaa2a51aa06472ee87153cc8 Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期一, 01 七月 2024 15:41:24 +0800
Subject: [PATCH] chore:添加ueditor
---
src/views/home/components/user-panel/index.vue | 35 +++++++++++++++++++++--------------
1 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/src/views/home/components/user-panel/index.vue b/src/views/home/components/user-panel/index.vue
index 6df38f4..228192f 100644
--- a/src/views/home/components/user-panel/index.vue
+++ b/src/views/home/components/user-panel/index.vue
@@ -1,5 +1,5 @@
<template>
- <div class="user-panel sticky max-w-sm min-w-96">
+ <div class="user-panel max-w-sm min-w-96 h-fit">
<el-card class="card">
<div class="panel-content flex flex-col items-center">
<div class="avatar-container w-40 h-40 rounded-full overflow-hidden">
@@ -20,7 +20,7 @@
</div>
<div class="tool-container grid grid-cols-3 gap-10">
- <div class="tool-item text-center cursor-pointer" v-for="item in toolList">
+ <div class="tool-item text-center cursor-pointer" v-for="item in toolList" @click="toolClick(item)">
<div class="tool-icon mb-1">
<img :src="item.iconPath" class="width-img" alt="">
</div>
@@ -38,34 +38,41 @@
<script setup>
import { ref, computed } from 'vue';
import randomColor from '@/utils/randomColor.js';
+import { useRouter } from 'vue-router';
+
+const router = useRouter();
const toolList = ref([
{
id: 1,
- title: '璧勬簮鍏变韩',
- iconPath: new URL('@/assets/icons/icon1.png', import.meta.url).href
+ title: '鍦ㄧ嚎鍩硅',
+ iconPath: new URL('@/assets/icons/icon1.png', import.meta.url).href,
+ path: '/train'
},
{
id: 2,
- title: '鎴戠殑璇剧▼',
- iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href
+ title: '鎴戠殑鑰冭瘯',
+ iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href,
+ path: '/exam-list'
},
{
id: 3,
- title: '鎴戠殑璇剧▼',
- iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href
- },
- {
- id: 4,
- title: '鎴戠殑璇剧▼',
- iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href
+ title: '鎴戠殑鎴愮哗',
+ iconPath: new URL('@/assets/icons/icon2.png', import.meta.url).href,
+ path: '/grade-list'
},
]);
const getColor = computed(() => {
return randomColor();
-})
+});
+
+const toolClick = (item) => {
+ if (item.path) {
+ router.push(item.path);
+ }
+}
</script>
--
Gitblit v1.8.0