-
Notifications
You must be signed in to change notification settings - Fork 8.3k
feat: add function support for formItemClass prop #6511
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
feat: add function support for formItemClass prop #6511
Conversation
|
WalkthroughThe changes introduce support for the Changes
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 1
🧹 Nitpick comments (1)
packages/@core/ui-kit/form-ui/src/types.ts (1)
180-183: Consider function parameters for enhanced flexibility.The current function signature
() => stringprovides basic dynamic class support. For more advanced use cases, consider if the function should receive parameters like form values or field context in future iterations.Current implementation is appropriate for the stated requirements.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docs/src/components/common-ui/vben-form.md(1 hunks)packages/@core/ui-kit/form-ui/src/form-render/form.vue(3 hunks)packages/@core/ui-kit/form-ui/src/types.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
packages/@core/ui-kit/form-ui/src/form-render/form.vue (1)
Learnt from: mynetfan
PR: vbenjs/vue-vben-admin#5075
File: packages/effects/common-ui/src/components/api-select/api-select.vue:61-62
Timestamp: 2024-12-09T04:41:58.914Z
Learning: 在文件 `packages/effects/common-ui/src/components/api-select/api-select.vue` 的组件 `ApiSelect` 中,`childrenField` 的默认值设置为空字符串是有意的,因为并非所有组件都使用树形数据。
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Test (windows-latest)
- GitHub Check: Lint (ubuntu-latest)
- GitHub Check: Lint (windows-latest)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: post-update (windows-latest)
- GitHub Check: post-update (ubuntu-latest)
🔇 Additional comments (4)
docs/src/components/common-ui/vben-form.md (1)
398-398: Documentation correctly reflects the new function support.The type annotation accurately represents the new union type that allows
formItemClassto be either a string or a function returning a string.packages/@core/ui-kit/form-ui/src/form-render/form.vue (2)
15-20: Import addition looks good.The
isFunctionutility import is necessary for the new functionality and is correctly added.
147-147: Correct usage of resolved class value.The resolved
formItemClassvalue is properly used in thecn()function call, maintaining the correct class merging behavior.packages/@core/ui-kit/form-ui/src/types.ts (1)
38-39: Well-designed type extension.The
FormItemClassTypeExtendedtype alias cleanly extends the existing functionality while maintaining backwards compatibility through the union type approach.
|
有类型警告的报错 看看能否解决 |
改啦 |
* feat: add function support for formItemClass prop * feat: add try-catch to formItemClass function * fix: formItemClass function ts error --------- Co-authored-by: sqchen <[email protected]>
Description
Type of change
Please delete options that are not relevant.
Summary by CodeRabbit
New Features
Documentation