fix(components): [table] cancel layout update when component unmount (#18440)

This commit is contained in:
btea 2024-10-04 09:24:45 +08:00 committed by GitHub
parent 86b01eed9f
commit 27e0c496e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -169,7 +169,13 @@
<script lang="ts">
// @ts-nocheck
import { computed, defineComponent, getCurrentInstance, provide } from 'vue'
import {
computed,
defineComponent,
getCurrentInstance,
onBeforeUnmount,
provide,
} from 'vue'
import { debounce } from 'lodash-unified'
import { Mousewheel } from '@element-plus/directives'
import { useLocale, useNamespace } from '@element-plus/hooks'
@ -305,6 +311,10 @@ export default defineComponent({
useKeyRender(table)
onBeforeUnmount(() => {
debouncedUpdateLayout.cancel()
})
return {
ns,
layout,