From 5d3f2aa7ccd9f761a6fd4224e7b49ceb6830abea Mon Sep 17 00:00:00 2001 From: 明梦爽 <2972214568@qq.com> Date: 星期二, 09 八月 2022 10:02:51 +0800 Subject: [PATCH] 删除未用到的依赖 --- src/views/work.vue | 74 +++++++++++++++++------------------- 1 files changed, 35 insertions(+), 39 deletions(-) diff --git a/src/views/work.vue b/src/views/work.vue index 2b54ea9..24096ba 100644 --- a/src/views/work.vue +++ b/src/views/work.vue @@ -1,16 +1,14 @@ <template> <div> - <el-row type="flex" justify="space-between" class="underline"> + <el-row type="flex" justify="space-between" class="underline row-bg"> <span class="color"><b>宸ヤ綔鍔ㄦ��</b></span> - <span @click="goMore('宸ヤ綔鐘舵��')" class="liPointer" - >鏇村<i class="el-icon-d-arrow-right"></i> - </span> + <span @click="goMore('宸ヤ綔鐘舵��')" class="liPointer">鏇村<i class="el-icon-d-arrow-right"></i> </span> </el-row> <div style="max-height:420px;overflow:hidden;"> <ul> <li :key="index" v-for="(item, index) in workList" class="liPointer"> - <div @click="toWorkMsg(item.title)" class="bgc mart10"> - {{ item.news }} + <div @click="toWorkMsg(item.id)" class="bgc mart10"> + {{ item.title }} </div> </li> </ul> @@ -18,51 +16,49 @@ </div> </template> <script> -import {getNewsList} from '../api/api' +import { getNewsList } from '../api/api' export default { - name:'work', - data(){ - return{ - workList: [{id:1,year: 2022,month:'1-10',count:10, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},{id:2,year: 2022,month:'1-10',count:11, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'}, - {id:3,year: 2022,month:'1-10',count:12, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},{id:4,year: 2022,month:'1-10',count:13, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'}, - {id:5,year: 2022,month:'1-10',count:14, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},{id:6,year: 2022,month:'1-10',count:14, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'}, - {id:6,year: 2022,month:'1-10',count:15, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},{id:6,year: 2022,month:'1-10',count:16, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'}, - {id:6,year: 2022,month:'1-10',count:16, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'},{id:6,year: 2022,month:'1-10',count:17, news:'浣犺蛋杩囩殑鍦版柟鍙墿涓嬫�濆康闅炬嵄锛屾妸浣犺棌鍦ㄥ績澶达紝姣忓ぉ姣忓鎯充綘'}], + name: 'work', + data() { + return { + workList: [] } }, created() { - // this.getnews(); + this.getnews() }, - methods:{ + methods: { //鑾峰彇鏂伴椈鍒楄〃 - // getnews() { - // const data = { - // categoryId: 2,//灏忔爣棰業D - // contypeId: 2,//澶ф爣棰業D - // p: 0//褰撳墠椤� - // }; - // getNewsList(data).then(res => { - // console.log('res',res); - // if(res.code == 200){ - // this.workList = res.data.records - // } - // }).catch(err => { - // console.log('err',err); - // }) - // }, - toWorkMsg(t) { + getnews() { + const data = { + current: 1, + newsCategoryId: 43, + size: 6 + } + getNewsList(data) + .then(res => { + console.log(res) + if (res.code == 200) { + this.workList = res.data.records + } + }) + .catch(error => { + console.log(error) + }) + }, + toWorkMsg(id) { this.$router.push({ - path:'/home/workMessage', + path: '/home/news', query: { - title:t + id: id } }) }, goMore(val) { this.$router.push({ - path:'moreMessage', - query:{ - type:val, + path: 'moreMessage', + query: { + type: val } }) } @@ -89,4 +85,4 @@ height: 55px; line-height: 55px; } -</style> \ No newline at end of file +</style> -- Gitblit v1.8.0