Skip to content

fix: 修正vxtable不存在formConfig时,直接变更data失效问题 - #7906

Merged
jinmao88 merged 1 commit into
vbenjs:mainfrom
xueyitt:main
May 16, 2026
Merged

jinmao88 merged 1 commit into
vbenjs:mainfrom
xueyitt:main

Conversation

@xueyitt

@xueyitt xueyitt commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

修正vxtable不存在formConfig时,直接变更data失效问题

Summary by CodeRabbit

  • Style
    • Realigned code formatting in internal component logic.

Note: This release contains no functional changes or user-visible updates.

Review Change Stack

修正vxtable不存在formConfig时,直接变更data失效问题
@changeset-bot

changeset-bot Bot commented May 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 30356a2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Lines 233–235 in use-vxe-grid.vue adjust the alignment of the mergedOptions.formConfig block closure and the tableData conditional assignment without changing the underlying control flow.

Changes

VxeTable Grid Options Alignment

Layer / File(s) Summary
Options Alignment
packages/effects/plugins/src/vxe-table/use-vxe-grid.vue
Code alignment adjustment for mergedOptions.formConfig block closure and tableData non-empty conditional assignment to mergedOptions.data.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • anncwb
  • vince292007
  • mynetfan

Poem

🐰 A line of code, a gentle shift,
Like morning light through morning's rift,
The config closes, data flows,
Alignment blooms where logic goes!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is minimal and lacks required template sections including detailed issue explanation, type of change checkboxes, and completion of the provided checklist. Expand the description to include detailed problem explanation, select the 'Bug fix' checkbox, and address the relevant checklist items from the template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the bug fix addressing the vxtable issue where data changes fail when formConfig is absent, matching the core change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/effects/plugins/src/vxe-table/use-vxe-grid.vue`:
- Around line 234-235: The guard using `tableData.value.length > 0` prevents
assigning an empty array and leaves stale rows; change the condition to detect
arrays (e.g. use `Array.isArray(tableData.value)`) and always set
`mergedOptions.data = tableData.value` when it is an array (including empty) so
clears propagate; update the assignment logic around `tableData` /
`mergedOptions.data` in use-vxe-grid accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b638c81c-4668-4d1d-be46-0760f4ab6042

📥 Commits

Reviewing files that changed from the base of the PR and between ba60bc3 and 30356a2.

📒 Files selected for processing (1)
  • packages/effects/plugins/src/vxe-table/use-vxe-grid.vue

Comment on lines +234 to +235
if (tableData.value && tableData.value.length > 0) {
mergedOptions.data = tableData.value;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Empty-array updates are still dropped, which can leave stale table rows.

On Line 234, the length > 0 guard prevents propagating tableData = [], so clearing data may not take effect and previous rows can remain visible. Assign whenever tableData.value is an array (including empty).

💡 Suggested fix
-  if (tableData.value && tableData.value.length > 0) {
-    mergedOptions.data = tableData.value;
-  }
+  if (Array.isArray(tableData.value)) {
+    mergedOptions.data = tableData.value;
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (tableData.value && tableData.value.length > 0) {
mergedOptions.data = tableData.value;
if (Array.isArray(tableData.value)) {
mergedOptions.data = tableData.value;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/effects/plugins/src/vxe-table/use-vxe-grid.vue` around lines 234 -
235, The guard using `tableData.value.length > 0` prevents assigning an empty
array and leaves stale rows; change the condition to detect arrays (e.g. use
`Array.isArray(tableData.value)`) and always set `mergedOptions.data =
tableData.value` when it is an array (including empty) so clears propagate;
update the assignment logic around `tableData` / `mergedOptions.data` in
use-vxe-grid accordingly.

@jinmao88
jinmao88 merged commit c8c4255 into vbenjs:main May 16, 2026
10 of 14 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants