-
Notifications
You must be signed in to change notification settings - Fork 101
feat(bubble): header support function #341
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
Conversation
✅ Deploy Preview for antd-design-x-vue ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThe changes update the Changes
Sequence Diagram(s)sequenceDiagram
participant Parent as Parent Component
participant Bubble as Bubble.vue
Parent->>Bubble: Passes header prop (VNode/string or function)
Bubble->>Bubble: Checks if header is function
alt header is function
Bubble->>Bubble: Calls header(content)
else header is VNode/string
Bubble->>Bubble: Uses header as-is
end
Bubble->>Parent: Invokes header slot with { content }
Possibly related PRs
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
src/bubble/Bubble.vueOops! Something went wrong! :( ESLint: 8.57.1 Error: Failed to load parser 'vue-eslint-parser' declared in '.eslintrc.js': Cannot find module 'vue-eslint-parser'
src/bubble/interface.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: Failed to load parser 'vue-eslint-parser' declared in '.eslintrc.js': Cannot find module 'vue-eslint-parser'
✨ 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: 0
🧹 Nitpick comments (1)
docs/component/bubble.md (1)
123-123
: Documentation correctly updated, minor type completeness note.The documentation properly reflects the new function signature. Note that the documented type shows
VNode
but the actual interface also allowsstring
returns - this appears consistent with the footer documentation pattern.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
docs/component/bubble.md
(2 hunks)src/bubble/Bubble.vue
(2 hunks)src/bubble/interface.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Redirect rules - antd-design-x-vue
- GitHub Check: Header rules - antd-design-x-vue
- GitHub Check: Pages changed - antd-design-x-vue
🔇 Additional comments (4)
src/bubble/interface.ts (1)
45-45
: LGTM! Consistent API design with footer property.The header property type now matches the footer property, providing a consistent API where both can accept either static content or a function that receives the bubble content.
docs/component/bubble.md (1)
139-139
: LGTM! Slot documentation correctly updated.The header slot documentation now properly shows it accepts a content parameter, maintaining consistency with the footer slot.
src/bubble/Bubble.vue (2)
40-42
: LGTM! Slot type definition correctly updated.The header slot now accepts an optional content parameter, maintaining backward compatibility while enabling the new functionality.
170-174
: Excellent implementation that maintains consistency with footer pattern.The header rendering logic correctly handles all three cases:
- Slot with content parameter
- Function prop with content argument
- Static content
This perfectly mirrors the footer implementation and maintains backward compatibility.
About #337 .
Summary by CodeRabbit