|
|
@ -16,7 +16,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { scrollTo } from '@/utils/scroll-to'
|
|
|
|
import {scrollTo} from '@/utils/scroll-to'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'Pagination',
|
|
|
|
name: 'Pagination',
|
|
|
@ -62,8 +62,7 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {};
|
|
|
|
};
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
currentPage: {
|
|
|
|
currentPage: {
|
|
|
@ -88,13 +87,13 @@ export default {
|
|
|
|
if (this.currentPage * val > this.total) {
|
|
|
|
if (this.currentPage * val > this.total) {
|
|
|
|
this.currentPage = 1
|
|
|
|
this.currentPage = 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.$emit('pagination', { page: this.currentPage, limit: val })
|
|
|
|
this.$emit('pagination', {page: this.currentPage, limit: val})
|
|
|
|
if (this.autoScroll) {
|
|
|
|
if (this.autoScroll) {
|
|
|
|
scrollTo(0, 800)
|
|
|
|
scrollTo(0, 800)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
handleCurrentChange(val) {
|
|
|
|
this.$emit('pagination', { page: val, limit: this.pageSize })
|
|
|
|
this.$emit('pagination', {page: val, limit: this.pageSize})
|
|
|
|
if (this.autoScroll) {
|
|
|
|
if (this.autoScroll) {
|
|
|
|
scrollTo(0, 800)
|
|
|
|
scrollTo(0, 800)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -108,6 +107,7 @@ export default {
|
|
|
|
background: #fff;
|
|
|
|
background: #fff;
|
|
|
|
padding: 32px 16px;
|
|
|
|
padding: 32px 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pagination-container.hidden {
|
|
|
|
.pagination-container.hidden {
|
|
|
|
display: none;
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|