| | |
| | | |
| | | <div class="tab-content"> |
| | | <ul class="news_ul"> |
| | | <li v-for="(item, index) in news" :key="index" @click="jumpmenu(item)"> |
| | | <li v-for="(item, index) in pages" :key="index" @click="jumpmenu(item)"> |
| | | <h3> |
| | | <img :src="item.Image1" alt=""> |
| | | </h3> |
| | |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | <el-pagination |
| | | background |
| | | layout="prev, pager, next" |
| | | hide-on-single-page |
| | | @current-change="changePage" |
| | | :current-page="pageIndex" |
| | | :page-size="9" |
| | | :total="news ? news.length : 0"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | return { |
| | | cur: 0, |
| | | tabs: null, |
| | | news: null |
| | | news: null, |
| | | pageIndex: 1, |
| | | pages: null |
| | | } |
| | | }, |
| | | methods: { |
| | | changePage (page) { |
| | | this.pages = [] |
| | | if (this.news) { |
| | | this.pages = this.news.slice((page - 1) * 9, page * 9) |
| | | } |
| | | }, |
| | | changetab (i) { |
| | | this.cur = i |
| | | this.pageIndex = 1 |
| | | this.news = null |
| | | this.loaddata() |
| | | }, |
| | | jumpmenu (item) { |
| | |
| | | } |
| | | } |
| | | sessionStorage.removeItem('newstype') |
| | | console.log(this.cur) |
| | | } catch (e) {} |
| | | |
| | | this.loaddata() |
| | |
| | | } |
| | | this.Service.getParamData(param).then(res => { |
| | | this.news = res.News |
| | | |
| | | this.pages = [] |
| | | if (this.news) { |
| | | this.pages = this.news.slice(0, 9) |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | .is-background { |
| | | display: none; |
| | | margin: 30px 0; |
| | | text-align: center; |
| | | } |
| | | button { |
| | | width: 50%; |
| | |
| | | display: none; |
| | | } |
| | | .is-background { |
| | | margin: .8rem 3rem; |
| | | margin: 30px 0 60px; |
| | | text-align: center; |
| | | } |
| | | .active { |
| | | background: #20B7FE; |