vue3+ts table表格滚动条滚动指定位置
scrollBarPosition() { nextTick(() => { setTimeout(() => { let dom = document.querySelector('.el-drawer__body') || (document.body as Element) const leftGap = dom.clientWidth > 1200 ? dom.scrollWidth / 1.4 : (dom.scrollWidth + dom.clientWidth) / 2 tableRef.value?.scrollTo({ left: leftGap, behavior: 'instant' }) }, 100) }) }