提交 215b5bd8 authored 作者: lihuihui's avatar lihuihui

修改文字分页

上级 9024a985
......@@ -80,7 +80,7 @@ export default {
high: '实习就业',
online: '在线教育<br />解决方案',
career: '新职业',
more: 'more'
more: '更多'
},
bulletin: {
title: '项目公告'
......
......@@ -21,15 +21,15 @@
</li>
</template>
</ul>
<!-- <div class="pages-box">
<div class="pages-box">
<el-pagination
layout="prev, pager, next"
@current-change="handleCurrentChange"
page-size="10"
:total="pages.total"
:page-size="limit"
:total="total"
>
</el-pagination>
</div> -->
</div>
</div>
</div>
</template>
......@@ -41,29 +41,53 @@ export default {
data() {
return {
listData: [],
pages: {}
currentPaeg: 1,
total: 0,
limit: 10
}
},
async fetch() {
const params = {
project_id: process.env.projectId,
type_tag: this.$route.query.type || 'article_news'
type_tag: this.$route.query.type || 'article_news',
page: this.currentPaeg,
limit: 10
}
this.listData = await this.$axios.get('/api/cms/api/v1/articles', { params }).then(res => {
this.total = res.data.total
return res.data.data
})
},
methods: {
handleCurrentChange() {},
handleCurrentChange(num) {
this.initData(num)
},
initData(num) {
const params = {
project_id: process.env.projectId,
type_tag: this.$route.query.type || 'article_news',
page: num,
limit: 10
}
this.listData = this.$axios.get('/api/cms/api/v1/articles', { params }).then(res => {
this.total = parseInt(res.data.total)
this.listData = res.data.data
})
},
formatDate(value) {
const date = new Date(value * 1000)
console.log(date.getMonth())
return date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate()
}
}
}
</script>
<style lang="scss" scoped>
.pages-box{
display: flex;
padding-bottom: 50px;
background: #fff;
justify-content: center;
}
.news-content {
width: 1200px;
margin: 0 auto;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论