From c832daf074e1a452b4960a1aea347169fcb40fde Mon Sep 17 00:00:00 2001 From: 明梦爽 <2972214568@qq.com> Date: 星期六, 06 十一月 2021 10:38:14 +0800 Subject: [PATCH] 学校首页完成 --- src/components/Home.vue | 55 +++++++++++++++++++++++++++---------------------------- 1 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/components/Home.vue b/src/components/Home.vue index 5b76a03..ba617d7 100644 --- a/src/components/Home.vue +++ b/src/components/Home.vue @@ -18,9 +18,9 @@ :default-active="activeIndex" @select="handleSelect" > - <el-menu-item + <el-menu-item :key="index" - v-for="(item,index) in menuList" + v-for="(item, index) in menuList" :index="item.index" > {{ item.name }} @@ -43,36 +43,35 @@ data() { return { activeIndex: 'index', - menuList:[ - {index:'index',name:'棣栭〉'}, - {index:'introduce',name:'绉戝崗姒傚喌'}, - {index:'zhengce',name:'鏀跨瓥娉曡'}, - {index:'keXieXiangMu',name:'绉戝崗椤圭洰'}, - {index:'xueShuJiaoLiu',name:'瀛︽湳浜ゆ祦'}, - {index:'banShiZhiNan',name:'鍔炰簨鎸囧崡'}, - {index:'kePu',name:'绉戞櫘椋庨噰'}, - {index:'xueXiaoShouYe',name:'瀛︽牎棣栭〉'}, - {index:'telephone',name:'鑱旂郴鎴戜滑'}, + menuList: [ + { index: 'index', name: '棣栭〉' }, + { index: 'introduce', name: '绉戝崗姒傚喌' }, + { index: 'zhengce', name: '鏀跨瓥娉曡' }, + { index: 'keXieXiangMu', name: '绉戝崗椤圭洰' }, + { index: 'xueShuJiaoLiu', name: '瀛︽湳浜ゆ祦' }, + { index: 'banShiZhiNan', name: '鍔炰簨鎸囧崡' }, + { index: 'kePu', name: '绉戞櫘椋庨噰' }, + { index: 'xueXiaoShouYe', name: '瀛︽牎棣栭〉' }, + { index: 'telephone', name: '鑱旂郴鎴戜滑' } ] } }, - created(){ - }, - mounted(){ - - }, - watch:{ - - }, + created() {}, + mounted() {}, + watch: {}, methods: { handleSelect(key, keyPath) { - // console.log(key, keyPath) - this.$router.push({ - path: '/home/' + key, - query:{ - title:key - } - }) + console.log(key, keyPath) + if (key == 'xueXiaoShouYe') { + window.location.href = 'https://www.pdsu.edu.cn/#' + } else { + this.$router.push({ + path: '/home/' + key, + query: { + title: key + } + }) + } } } } @@ -126,7 +125,7 @@ text-align: center; line-height: 60px; } -.box{ +.box { width: 1200px; margin: 0 auto; } -- Gitblit v1.8.0