852824d7 by simon

默认提交

1 parent 3ca02206
...@@ -10,6 +10,11 @@ export default { ...@@ -10,6 +10,11 @@ export default {
10 total: { 10 total: {
11 type: Number, 11 type: Number,
12 default: 1 12 default: 1
13 },
14 // 总条数,名字自取 还有国家化
15 totalItem: {
16 type: Number,
17 default: 1
13 } 18 }
14 }, 19 },
15 data() { 20 data() {
......
...@@ -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>
......