From 71b92b0c6d3d7efd603d9fcb84506be0cbf0e4a6 Mon Sep 17 00:00:00 2001
From: 明梦爽 <2972214568@qq.com>
Date: 星期一, 08 八月 2022 18:20:39 +0800
Subject: [PATCH] 完善Readme
---
src/components/Home.vue | 49 ++++++++++++++++++++++++++++++-------------------
1 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/src/components/Home.vue b/src/components/Home.vue
index 7bafe07..d969782 100644
--- a/src/components/Home.vue
+++ b/src/components/Home.vue
@@ -6,13 +6,13 @@
<img src="../assets/xiaohui4.png" alt="" />
</div>
<div>
- <img src="../assets/bg.png" alt="">
+ <img src="../assets/bg.png" alt="" />
</div>
</el-header>
<!-- 涓婚〉瀵艰埅鏍� -->
<el-row>
<el-menu mode="horizontal" background-color="rgb(64, 112, 186)" text-color="white" class="menu" active-text-color="#000000" :default-active="activeIndex" @select="handleSelect">
- <el-menu-item :key="index" v-for="(item, index) in menuList" :index="(item.id).toString()">
+ <el-menu-item :key="index" v-for="(item, index) in menuList" :index="item.id.toString()">
{{ item.name }}
</el-menu-item>
</el-menu>
@@ -28,30 +28,41 @@
</template>
<script>
-import {getNavList} from '../api/api'
+import { getNavList } from '../api/api'
import axios from 'axios'
export default {
name: '',
data() {
return {
activeIndex: '1',
- menuList: [{name: '棣栭〉',id: 1},{name: '绉戝崗姒傚喌',id: 22},{name: '鏀跨瓥娉曡',id: 23},{name: '绉戝崗椤圭洰',id: 24},
- {name: '瀛︽湳浜ゆ祦',id: 25},{name: '鍔炰簨鎸囧崡',id: 26},{name: '绉戞櫘椋庨噰',id: 27},{name: '瀛︽牎棣栭〉',id: 28},
- {name: '鑱旂郴鎴戜滑',id: 29}],
- menuList2:[]
+ menuList: [
+ { name: '棣栭〉', id: 1 },
+ { name: '绉戝崗姒傚喌', id: 22 },
+ { name: '鏀跨瓥娉曡', id: 23 },
+ { name: '绉戝崗椤圭洰', id: 24 },
+ { name: '瀛︽湳浜ゆ祦', id: 25 },
+ { name: '鍔炰簨鎸囧崡', id: 26 },
+ { name: '绉戞櫘椋庨噰', id: 27 },
+ { name: '瀛︽牎棣栭〉', id: 28 },
+ { name: '鑱旂郴鎴戜滑', id: 29 }
+ ],
+ menuList2: []
}
},
created() {
// this.getNavArr();
},
mounted() {
- let api3 = 'http://localhost:8080/news_type/all'
- axios.get(api3).then((res)=>{
- // console.log(res);
- this.menuList2 = res.data.data
- }).catch((error)=>{
- console.log(error);
- })
+ let api3 = 'http://localhost:7070/news_type/all'
+ axios
+ .get(api3)
+ .then(res => {
+ // console.log(res);
+ this.menuList2 = res.data.data
+ })
+ .catch(error => {
+ console.log(error)
+ })
},
watch: {},
methods: {
@@ -68,9 +79,9 @@
// console.log('err', err)
// })
// },
-
- formatterTitle(t){
- switch(t){
+
+ formatterTitle(t) {
+ switch (t) {
case '1':
return 'index'
case '22':
@@ -99,7 +110,7 @@
path: '/home/' + this.formatterTitle(key),
query: {
title: this.formatterTitle(key),
- id:key
+ id: key
}
})
}
@@ -150,4 +161,4 @@
width: 1200px;
margin: 0 auto;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.8.0