优化渲染顺序
This commit is contained in:
@@ -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)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user