852824d7 by simon

默认提交

1 parent 3ca02206
......@@ -10,6 +10,11 @@ export default {
total: {
type: Number,
default: 1
},
// 总条数,名字自取 还有国家化
totalItem: {
type: Number,
default: 1
}
},
data() {
......
......@@ -2,6 +2,7 @@
<template>
<div class="comp">
<div class="pagination gird-g">
<div><span class="t1">{{totalItem}}</span></div>
<div class="pagination-item">
<span class="pointer" :class="{'pagination-disabled' : cur == 1}">
<a @click="prevPage()">{{$t('pagination.firstPage')}}</a>
......
......@@ -37,12 +37,24 @@ export default {
let {
page
} = val;
this.queryForm.page = page;
// this.queryForm.page = page;
this.$router.push({
path: "/news/list",
query: {
page: page
}
});
this.initData();
},
initData() {
let l = this.$i18n.locale;
this.queryForm.l = l;
let page = this.$route.query.page || 1;
this.queryForm.page = page;
this.$nextTick(()=>{
this.$refs.pagination.selPage(page);
});
httpGet({ url: api.newsList, data: this.queryForm }).then(res => {
let newsList = res.list;
newsList.forEach(element => {
......
......@@ -40,7 +40,7 @@
&-tit {
display: flex;
align-items: center;
flex: 1;
// flex: 1;
.point {
width: .5rem;
......@@ -89,6 +89,7 @@
&-item {
&-tit {
flex: 1;
.point {
width: .5rem;
height: .5rem;
......
......@@ -15,7 +15,7 @@
<div class="news-item-date">{{item.dateFormat}}</div>
</div>
</div>
<pagination @selpage="selPage" :total="total" class="pagination"></pagination>
<pagination ref="pagination" @selpage="selPage" :total="total" class="pagination"></pagination>
</div>
</div>
</div>
......