fix(grid): fix dirty flag not clear after refreshData (#3560)

* fix(directive): fix clickoutside mouse down event may be null

* fix(grid): fix dirty flag not clear after refreshData
This commit is contained in:
gimmyhehe 2025-07-09 16:57:13 +08:00 committed by GitHub
parent 6801abcafc
commit 49992e20cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -41,12 +41,12 @@ const createDocumentHandler = (el, binding, vnode) =>
// composedPath() 会返回事件的完整路径,即使事件穿过了 Shadow DOM 的边界。 // composedPath() 会返回事件的完整路径,即使事件穿过了 Shadow DOM 的边界。
// 这确保了即使 popperElm 在 Shadow DOM 外部(或组件本身在 Shadow DOM 内部), // 这确保了即使 popperElm 在 Shadow DOM 外部(或组件本身在 Shadow DOM 内部),
// 我们也能准确判断点击是否发生在组件或其 popper 内部。 // 我们也能准确判断点击是否发生在组件或其 popper 内部。
const mousedownPath = (mousedown?.composedPath && mousedown.composedPath()) || [mousedown?.target] const mousedownPath = mousedown?.composedPath?.() || [mousedown?.target]
const mouseupPath = (mouseup?.composedPath && mouseup.composedPath()) || [mouseup.target] const mouseupPath = mouseup?.composedPath?.() || [mouseup?.target]
const isClickInEl = mousedownPath.includes(el) || mouseupPath.includes(el) const isClickInEl = mousedownPath.includes(el) || mouseupPath.includes(el)
const isClickInPopper = popperElm && (mousedownPath.includes(popperElm) || mouseupPath.includes(popperElm)) const isClickInPopper = popperElm && (mousedownPath.includes(popperElm) || mouseupPath.includes(popperElm))
if (!mousedown.target || !mouseup.target || isClickInEl || isClickInPopper) { if (!mousedown?.target || !mouseup?.target || isClickInEl || isClickInPopper) {
return return
} }

View File

@ -230,6 +230,7 @@ const Methods = {
refreshData(data) { refreshData(data) {
const next = () => { const next = () => {
this.tableData = [] this.tableData = []
this.cellStatus.clear()
return this.loadTableData(data || this.tableFullData) return this.loadTableData(data || this.tableFullData)
} }
return this.$nextTick().then(next) return this.$nextTick().then(next)