默认提交
Showing
5 changed files
with
22 additions
and
3 deletions
... | @@ -2,6 +2,7 @@ | ... | @@ -2,6 +2,7 @@ |
2 | <template> | 2 | <template> |
3 | <div class="comp"> | 3 | <div class="comp"> |
4 | <div class="pagination gird-g"> | 4 | <div class="pagination gird-g"> |
5 | <div>共<span class="t1">{{totalItem}}</span>条</div> | ||
5 | <div class="pagination-item"> | 6 | <div class="pagination-item"> |
6 | <span class="pointer" :class="{'pagination-disabled' : cur == 1}"> | 7 | <span class="pointer" :class="{'pagination-disabled' : cur == 1}"> |
7 | <a @click="prevPage()">{{$t('pagination.firstPage')}}</a> | 8 | <a @click="prevPage()">{{$t('pagination.firstPage')}}</a> | ... | ... |
... | @@ -37,12 +37,24 @@ export default { | ... | @@ -37,12 +37,24 @@ export default { |
37 | let { | 37 | let { |
38 | page | 38 | page |
39 | } = val; | 39 | } = val; |
40 | this.queryForm.page = page; | 40 | // this.queryForm.page = page; |
41 | this.$router.push({ | ||
42 | path: "/news/list", | ||
43 | query: { | ||
44 | page: page | ||
45 | } | ||
46 | }); | ||
41 | this.initData(); | 47 | this.initData(); |
42 | }, | 48 | }, |
43 | initData() { | 49 | initData() { |
44 | let l = this.$i18n.locale; | 50 | let l = this.$i18n.locale; |
45 | this.queryForm.l = l; | 51 | this.queryForm.l = l; |
52 | let page = this.$route.query.page || 1; | ||
53 | this.queryForm.page = page; | ||
54 | this.$nextTick(()=>{ | ||
55 | this.$refs.pagination.selPage(page); | ||
56 | }); | ||
57 | |||
46 | httpGet({ url: api.newsList, data: this.queryForm }).then(res => { | 58 | httpGet({ url: api.newsList, data: this.queryForm }).then(res => { |
47 | let newsList = res.list; | 59 | let newsList = res.list; |
48 | newsList.forEach(element => { | 60 | newsList.forEach(element => { | ... | ... |
... | @@ -40,7 +40,7 @@ | ... | @@ -40,7 +40,7 @@ |
40 | &-tit { | 40 | &-tit { |
41 | display: flex; | 41 | display: flex; |
42 | align-items: center; | 42 | align-items: center; |
43 | flex: 1; | 43 | // flex: 1; |
44 | 44 | ||
45 | .point { | 45 | .point { |
46 | width: .5rem; | 46 | width: .5rem; |
... | @@ -89,6 +89,7 @@ | ... | @@ -89,6 +89,7 @@ |
89 | 89 | ||
90 | &-item { | 90 | &-item { |
91 | &-tit { | 91 | &-tit { |
92 | flex: 1; | ||
92 | .point { | 93 | .point { |
93 | width: .5rem; | 94 | width: .5rem; |
94 | height: .5rem; | 95 | height: .5rem; | ... | ... |
... | @@ -15,7 +15,7 @@ | ... | @@ -15,7 +15,7 @@ |
15 | <div class="news-item-date">{{item.dateFormat}}</div> | 15 | <div class="news-item-date">{{item.dateFormat}}</div> |
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
18 | <pagination @selpage="selPage" :total="total" class="pagination"></pagination> | 18 | <pagination ref="pagination" @selpage="selPage" :total="total" class="pagination"></pagination> |
19 | </div> | 19 | </div> |
20 | </div> | 20 | </div> |
21 | </div> | 21 | </div> | ... | ... |
-
Please register or sign in to post a comment