fix(grid): fix index not update at drag row (#3622)

This commit is contained in:
gimmyhehe 2025-07-31 09:26:15 +08:00 committed by GitHub
parent db03876549
commit f3c2499ab7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -25,7 +25,6 @@
import { findTree } from '@opentiny/vue-renderless/grid/static/'
import Modal from '@opentiny/vue-modal'
import GlobalConfig from '../../config'
import { isVue2 } from '@opentiny/vue-common'
export const createHandlerOnEnd = ({ _vm, refresh }) => {
return (event) => {
@ -79,8 +78,7 @@ export const createHandlerOnEnd = ({ _vm, refresh }) => {
// 如果变动了树层级,需要刷新数据
_vm.$emit('row-drop-end', event, _vm, _vm.scrollYLoad ? tableTreeData : _vm.tableFullData)
// 因为vue2劫持了数组方法所以在data通过splice改变数组时数组长度不变会触发更新但是vue3是浅层响应所以需要通过传递数据让表格更新
refresh && _vm.data && !isVue2 && _vm.refreshData(_vm.data)
refresh && _vm.data && _vm.refreshData(_vm.data)
}
}