1.优化分类页面的点击分页后浏览量不显示的bug;2.优化点击分页后切换其他分类,分页没有初始化。

This commit is contained in:
reco_luan 2019-05-08 11:45:49 +08:00
parent 697e955a60
commit a371101a2b
4 changed files with 8 additions and 18 deletions

View File

@ -142,7 +142,6 @@ export default {
}
this.isHasPageKey = pageKeys && pageKeys.indexOf(sessionStorage.getItem('pageKey')) > -1
console.log(123, this.isHasPageKey, pageKeys)
},
toggleSidebar (to) {
this.isSidebarOpen = typeof to === 'boolean' ? to : !this.isSidebarOpen

View File

@ -1,8 +1,9 @@
<template>
<div class="abstract-wrapper">
<div
v-for="item in formatData"
v-for="(item, index) in data"
:key="item.path"
v-show="index >= (currentPage * 10 - 10) && index < currentPage * 10"
class="abstract-item">
<div class="title">
<router-link
@ -20,14 +21,7 @@ import PageInfo from './PageInfo'
export default {
components: { PageInfo },
props: ['data', 'currentPage', 'currentTag'],
computed: {
formatData () {
const data = this.data
const currentPage = this.currentPage
return data.slice(currentPage * 10 - 10, currentPage * 10)
}
}
props: ['data', 'currentPage', 'currentTag']
}
</script>

View File

@ -22,8 +22,8 @@
<script>
import Common from '@theme/components/Common.vue'
import NoteAbstract from '../components//NoteAbstract.vue'
import Pagation from '../components//Pagation.vue'
import NoteAbstract from '@theme/components/NoteAbstract.vue'
import Pagation from '@theme/components/Pagation.vue'
export default {
components: { Common, NoteAbstract, Pagation },
@ -42,6 +42,7 @@ export default {
posts.sort((a, b) => {
return this._getTimeNum(b) - this._getTimeNum(a)
})
this.getCurrentPage(1)
return posts
},
//
@ -89,5 +90,3 @@ export default {
float none
text-align left
</style>

View File

@ -125,5 +125,3 @@ export default {
.tags-wrapper
padding: 5rem 0.6rem 0;
</style>