-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(@vben/plugins/vxe-table): after resetting the search, the parameters still exist #4577
Conversation
|
WalkthroughThe changes in this pull request primarily focus on enhancing the form handling capabilities within the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/effects/plugins/src/vxe-table/use-vxe-grid.vue (1)
Line range hint
145-150
: Overall impact and suggestion for improvementThe change effectively addresses the issue without introducing significant alterations to the component's structure or logic. It's a focused fix that aligns well with the PR objectives and resolves the problem described in issue #4575.
To further enhance the robustness of this function, consider adding error handling:
handleReset: async () => { try { await formApi.resetForm(); const formValues = formApi.form.values; props.api.reload(formValues); } catch (error) { console.error('Error resetting form:', error); // Optionally, you could add user feedback here } },This addition would ensure that any potential errors during the form reset process are caught and logged, improving the component's reliability and ease of debugging.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
- packages/effects/plugins/src/vxe-table/use-vxe-grid.vue (1 hunks)
- pnpm-workspace.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- pnpm-workspace.yaml
🔇 Additional comments (1)
packages/effects/plugins/src/vxe-table/use-vxe-grid.vue (1)
146-146
: Excellent fix for the search reset issue!The addition of
await
beforeformApi.resetForm()
is a crucial improvement. This change ensures that the form reset operation completes before retrieving the form values and reloading the grid. As a result, it effectively addresses the issue where old parameters were being sent in requests after resetting the search.This modification:
- Guarantees that
formApi.form.values
contains the reset values.- Aligns with best practices for handling asynchronous operations.
- Provides a minimal and focused fix, reducing the risk of introducing new issues.
Great job on identifying and implementing this solution!
Description
fixed #4575
Type of change
Please delete options that are not relevant.
pnpm-lock.yaml
unless you introduce a new test example.Checklist
pnpm run docs:dev
command.pnpm test
.feat:
,fix:
,perf:
,docs:
, orchore:
.Summary by CodeRabbit
New Features
Bug Fixes
Chores
vxe-pc-ui
package to the latest version.