|
@@ -74,6 +74,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
|
+ keepScroll: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
border: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
@@ -97,7 +101,22 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- properties: {}
|
|
|
+ cacheScrollLeft: 0,
|
|
|
+ cacheScrollTop: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ if (this.keepScroll && (this.cacheScrollLeft || this.cacheScrollTop)) {
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$refs.table.bodyWrapper.scrollLeft = this.cacheScrollLeft
|
|
|
+ this.$refs.table.bodyWrapper.scrollTop = this.cacheScrollTop
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deactivated() {
|
|
|
+ if (this.keepScroll) {
|
|
|
+ this.cacheScrollLeft = this.$refs.table.bodyWrapper.scrollLeft
|
|
|
+ this.cacheScrollTop = this.$refs.table.bodyWrapper.scrollTop
|
|
|
}
|
|
|
},
|
|
|
methods: {
|