-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
docs: add form slots docs #4992
Conversation
|
WalkthroughThe pull request updates the documentation for the Vben Form component, adding a new "Slots" section that explains the use of custom slots for inserting content in the form. It also clarifies the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 (2)
docs/src/components/common-ui/vben-form.md (2)
422-422
: Consider adding English translation for consistencyThe comment "自定义组件内部渲染" (Custom component internal rendering) should include an English translation to maintain consistency with the rest of the documentation's bilingual format.
- /** 自定义组件内部渲染 */ + /** 自定义组件内部渲染 (Custom component internal rendering) */
503-519
: Enhance slots documentation with examplesThe slots documentation is well-structured but could be more helpful with practical examples. Consider:
- Adding usage examples for built-in slots
- Including a code example demonstrating field name slots
Here's a suggested addition:
| expand-after | 展开按钮之后的位置 | +### Examples + +```vue +<!-- Using built-in slots --> +<VbenForm> + <template #submit-before> + <Button>Custom Action</Button> + </template> +</VbenForm> + +<!-- Using field name as slot --> +<VbenForm :schema="[{ fieldName: 'customField', label: 'Custom' }]"> + <template #customField> + <div>Custom Field Content</div> + </template> +</VbenForm> +``` ::: tip 字段插槽
Description
添加Form的Slots文档
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
renderComponentContent
property in theFormSchema
interface.