fix(grid): 修复tabs切换表格配置autoresize有闪动问题

This commit is contained in:
zzcr 2023-07-09 18:59:37 -07:00
parent ef951b3922
commit 0c1e8dc763
No known key found for this signature in database
GPG Key ID: F6C4DFD2EF53A673
1 changed files with 3 additions and 3 deletions

View File

@ -23,15 +23,15 @@
* *
*/ */
import Resize from '@opentiny/vue-renderless/grid/plugins/resize' import Resize from '@opentiny/vue-renderless/grid/plugins/resize'
import debounce from '@opentiny/vue-renderless/common/deps/debounce' import GlobalConfig from '../../config'
export default { export default {
bindResize() { bindResize() {
const resizeObserver = new Resize(debounce(16, () => { const resizeObserver = new Resize(() => {
this.updateParentHeight() this.updateParentHeight()
this.updateTableBodyHeight() this.updateTableBodyHeight()
this.recalculate() this.recalculate()
})) }, GlobalConfig.resizeInterval)
resizeObserver.observe(this.getParentElem()) resizeObserver.observe(this.getParentElem())
this.$resize = resizeObserver this.$resize = resizeObserver