Commit 5fb4e0e0 by xinla

列表UE优化

1 parent 106ff391
<template>
<div class="pagination-container">
<div class="pagination-container" ref="pagination">
<el-pagination
:background="background"
:current-page.sync="currentPage"
......@@ -67,22 +67,34 @@ export default {
handleSizeChange(val) {
this.$emit('pagination', { page: this.currentPage, limit: val })
if (this.autoScroll) {
scrollTo(0, 800)
this.scrollTo()
}
},
handleCurrentChange(val) {
this.$emit('pagination', { page: val, limit: this.pageSize })
if (this.autoScroll) {
scrollTo(0, 800)
this.scrollTo()
}
},
scrollTo() {
setTimeout(() => {
this.$refs.pagination.parentNode.scrollTop = 0
document.querySelector('.page.container').scrollTop = 0
}, 200)
},
},
}
</script>
<style scoped>
.pagination-container {
padding: 15px 5px 0;
position: sticky;
bottom: -20px;
margin-bottom: -20px;
z-index: 9;
background: #fff;
border-top: 1px solid #f8f8f8;
padding: 15px 5px 20px;
text-align: right;
}
.pagination-container.hidden {
......
......@@ -91,6 +91,7 @@ export default {
height: 100%;
overflow-y: auto;
overflow-x: hidden;
scroll-behavior: smooth;
}
.page {
// background: #fff;
......
......@@ -576,4 +576,10 @@
.el-scrollbar__bar.is-vertical {
width: 5px;
}
// 让加载遮罩层不随内容滚动
.el-loading-mask {
// position: sticky;
// height: 100%;
}
// }
......@@ -177,6 +177,7 @@ div:focus {
background: #fff;
overflow: auto;
padding: 20px;
scroll-behavior: smooth;
&:not(:first-child) {
margin-top: var(--card-margin);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!