Commit 5fb4e0e0 by xinla

列表UE优化

1 parent 106ff391
<template> <template>
<div class="pagination-container"> <div class="pagination-container" ref="pagination">
<el-pagination <el-pagination
:background="background" :background="background"
:current-page.sync="currentPage" :current-page.sync="currentPage"
...@@ -67,22 +67,34 @@ export default { ...@@ -67,22 +67,34 @@ export default {
handleSizeChange(val) { handleSizeChange(val) {
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) this.scrollTo()
} }
}, },
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) this.scrollTo()
} }
}, },
scrollTo() {
setTimeout(() => {
this.$refs.pagination.parentNode.scrollTop = 0
document.querySelector('.page.container').scrollTop = 0
}, 200)
},
}, },
} }
</script> </script>
<style scoped> <style scoped>
.pagination-container { .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; text-align: right;
} }
.pagination-container.hidden { .pagination-container.hidden {
......
...@@ -91,6 +91,7 @@ export default { ...@@ -91,6 +91,7 @@ export default {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
scroll-behavior: smooth;
} }
.page { .page {
// background: #fff; // background: #fff;
......
...@@ -576,4 +576,10 @@ ...@@ -576,4 +576,10 @@
.el-scrollbar__bar.is-vertical { .el-scrollbar__bar.is-vertical {
width: 5px; width: 5px;
} }
// 让加载遮罩层不随内容滚动
.el-loading-mask {
// position: sticky;
// height: 100%;
}
// } // }
...@@ -177,6 +177,7 @@ div:focus { ...@@ -177,6 +177,7 @@ div:focus {
background: #fff; background: #fff;
overflow: auto; overflow: auto;
padding: 20px; padding: 20px;
scroll-behavior: smooth;
&:not(:first-child) { &:not(:first-child) {
margin-top: var(--card-margin); 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!