From aef7583ccccd04b6f63a81d8cdf174bdb57d390f Mon Sep 17 00:00:00 2001 From: 明梦爽 <2972214568@qq.com> Date: 星期六, 06 十一月 2021 16:20:01 +0800 Subject: [PATCH] 科协概况完成 --- src/components/Home.vue | 51 +++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/components/Home.vue b/src/components/Home.vue index 331fb98..ba617d7 100644 --- a/src/components/Home.vue +++ b/src/components/Home.vue @@ -18,21 +18,19 @@ :default-active="activeIndex" @select="handleSelect" > - <el-menu-item index="index">棣栭〉</el-menu-item> - <el-menu-item index="introduce">绉戝崗姒傚喌</el-menu-item> - <el-menu-item index="zhengce">鏀跨瓥娉曡</el-menu-item> - <el-menu-item index="keXieXiangMu">绉戝崗椤圭洰</el-menu-item> - <el-menu-item index="xueShuJiaoLiu">瀛︽湳浜ゆ祦</el-menu-item> - <el-menu-item index="banShiZhiNan">鍔炰簨鎸囧崡</el-menu-item> - <el-menu-item index="kePu">绉戞櫘椋庨噰</el-menu-item> - <el-menu-item index="xueXiaoShouYe">瀛︽牎棣栭〉</el-menu-item> - <el-menu-item index="telephone">鑱旂郴鎴戜滑</el-menu-item> + <el-menu-item + :key="index" + v-for="(item, index) in menuList" + :index="item.index" + > + {{ item.name }} + </el-menu-item> </el-menu> </el-row> <el-container> <!-- 鏇村彉鐨勫唴瀹瑰尯鍩� --> <el-main class="main"> - <router-view></router-view> + <router-view class="box"></router-view> </el-main> </el-container> <el-footer>@骞抽《灞卞闄㈢瀛︽妧鏈崗浼�</el-footer> @@ -44,15 +42,36 @@ name: '', data() { return { - activeIndex: 'index' + 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: '鑱旂郴鎴戜滑' } + ] } }, + created() {}, + mounted() {}, + watch: {}, methods: { handleSelect(key, keyPath) { console.log(key, keyPath) - this.$router.push({ - path: '/home/' + keyPath - }) + if (key == 'xueXiaoShouYe') { + window.location.href = 'https://www.pdsu.edu.cn/#' + } else { + this.$router.push({ + path: '/home/' + key, + query: { + title: key + } + }) + } } } } @@ -106,4 +125,8 @@ text-align: center; line-height: 60px; } +.box { + width: 1200px; + margin: 0 auto; +} </style> \ No newline at end of file -- Gitblit v1.8.0