| @@ -5,21 +5,23 @@ | |||||
| <!-- <div @click="goparticulars"> | <!-- <div @click="goparticulars"> | ||||
| <detail v-for="(item, index) in newsList" :key="index" /> | <detail v-for="(item, index) in newsList" :key="index" /> | ||||
| </div> --> | </div> --> | ||||
| <div class="detailBox" v-for="(item, index) in newsList" :key="index" @click="goparticulars(item)"> | |||||
| <div class="imgBox"> | |||||
| <img class="img" :src="item.mainPicRealPath" /> | |||||
| <div class="text"> | |||||
| <h3>{{item.title}}</h3> | |||||
| <p v-html="item.content"></p> | |||||
| <span class="time">{{item.publishDate}} <span class="el-icon-view"> {{item.view}}</span></span> | |||||
| <div class="newsList"> | |||||
| <div class="detailBox" v-for="(item, index) in newsList" :key="index" @click="goparticulars(item)"> | |||||
| <div class="imgBox"> | |||||
| <img class="img" :src="item.mainPicRealPath" /> | |||||
| <div class="text"> | |||||
| <h3>{{item.title}}</h3> | |||||
| <p v-html="item.content"></p> | |||||
| <span class="time">{{item.publishDate}} <span class="el-icon-view"> {{item.view}}</span></span> | |||||
| </div> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <el-pagination class="pagination" :current-page.sync="paging.pageNum" :page-size="paging.pageSize" @current-change="handleCurrentChange" | |||||
| background | |||||
| layout="prev, pager, next" | |||||
| :total="paging.total"> | |||||
| </el-pagination> | |||||
| </div> | </div> | ||||
| <el-pagination :current-page.sync="paging.pageNum" | |||||
| background | |||||
| layout="prev, pager, next" | |||||
| :total="paging.total"> | |||||
| </el-pagination> | |||||
| </div> | </div> | ||||
| <sidebar /> | <sidebar /> | ||||
| </div> | </div> | ||||
| @@ -64,7 +66,10 @@ export default { | |||||
| this.paging.total = Number(res.total) | this.paging.total = Number(res.total) | ||||
| this.newsList = res.list | this.newsList = res.list | ||||
| }) | }) | ||||
| } | |||||
| }, | |||||
| handleCurrentChange(val) { | |||||
| this.getNewsList() | |||||
| }, | |||||
| }, | }, | ||||
| created() { | created() { | ||||
| this.getNewsList() | this.getNewsList() | ||||
| @@ -72,9 +77,18 @@ export default { | |||||
| }; | }; | ||||
| </script> | </script> | ||||
| <style lang="scss" scoped> | <style lang="scss" scoped> | ||||
| .el-pagination{ | |||||
| .newsList{ | |||||
| height: 550px; | |||||
| overflow: auto; | |||||
| position: relative; | |||||
| } | |||||
| .newsList .el-pagination{ | |||||
| text-align: center; | text-align: center; | ||||
| margin-top: 20px; | margin-top: 20px; | ||||
| position:absolute; | |||||
| bottom: 0; | |||||
| left: 40%; | |||||
| } | } | ||||
| .detailBox { | .detailBox { | ||||
| margin-top: 30px; | margin-top: 30px; | ||||