diff --git a/packages/vue/src/grid/src/table/src/methods.ts b/packages/vue/src/grid/src/table/src/methods.ts index 3cfdf6499e..d3239229c4 100644 --- a/packages/vue/src/grid/src/table/src/methods.ts +++ b/packages/vue/src/grid/src/table/src/methods.ts @@ -2048,7 +2048,7 @@ const Methods = { }, handleDataChange() { if (Array.isArray(this.data)) { - !this._isUpdateData && this.loadTableData(this.data, true) + !this._isUpdateData && this.loadTableData(this.data) this._isUpdateData = false } }, diff --git a/packages/vue/src/grid/src/table/src/table.ts b/packages/vue/src/grid/src/table/src/table.ts index b0cd9d882f..88e04acdd5 100644 --- a/packages/vue/src/grid/src/table/src/table.ts +++ b/packages/vue/src/grid/src/table/src/table.ts @@ -30,7 +30,8 @@ import { resolveTheme, defineComponent, useInstanceSlots, - useRelation + useRelation, + isVue2 } from '@opentiny/vue-common' import Tooltip from '@opentiny/vue-tooltip' import { extend } from '@opentiny/utils' @@ -539,7 +540,15 @@ export default defineComponent({ this.handleSelectionHeader() }, parentHeight() { - this.$nextTick(this.recalculate) + this.recalculate() + }, + // 选项式监控在vue2可以检测到顶层数组splice项替换/$set项替换 + // array.splice(index, 1, newItem) + // this.$set(array, index, newItem) + data(array1, array2) { + if (isVue2 && array1 === array2 && array1.length === array2.length) { + this.handleDataChange() + } } }, created() {