优化渲染顺序

This commit is contained in:
aixianling
2024-10-23 10:42:53 +08:00
parent 88b22acf20
commit e6253c9ac8

View File

@@ -146,12 +146,13 @@ Vue.component("scrollTable", {
},
methods: {
initScroll() {
const {SimpleBar} = window
const dom = this.$el.querySelector('.el-table__body-wrapper')
this.scroll = new SimpleBar(dom)
dom.addEventListener('mouseover', this.stopAutoScroll)
// dom.addEventListener('mouseout', this.autoScroll)
// this.scroll.refresh();
const {SimpleBar, $waitFor} = window
$waitFor(this.$el.querySelector('.el-table__body-wrapper')).then(dom => {
this.scroll = new SimpleBar(dom)
dom.addEventListener('mouseover', this.stopAutoScroll)
// dom.addEventListener('mouseout', this.autoScroll)
// this.scroll.refresh();
})
},
autoScroll() {
if (this.timer) clearInterval(this.timer)
@@ -165,7 +166,8 @@ Vue.component("scrollTable", {
}, 60)
},
stopAutoScroll() {
this.$el.querySelector('.simplebar-vertical').style.display = 'block'
const {$waitFor} = window
$waitFor(this.$el.querySelector('.simplebar-vertical')).then(dom => dom.style.display = 'block')
if (this.timer) clearInterval(this.timer)
}
},