feat(components): [popover] expose hide() through slot#23694
Conversation
📝 WalkthroughWalkthroughPopover's default slot now exposes a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
commit: |
|
🧪 Playground Preview: https://element-plus.run/?pr=23694 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/en-US/component/popover.md (1)
111-111: Clarify the slot description wording.The phrase "can receive the hide parameter" is imprecise. The slot doesn't receive a parameter—it exposes a scoped slot prop. Consider revising for clarity:
📝 Suggested wording improvement
-| default | content of popover, version ^(2.13.3) and later can receive the hide parameter. | ^[object]`{hide: () => void}` | +| default | content of popover, version ^(2.13.3) and later exposes a hide function via scoped slot. | ^[object]`{hide: () => void}` |Alternatively:
-| default | content of popover, version ^(2.13.3) and later can receive the hide parameter. | ^[object]`{hide: () => void}` | +| default | content of popover, version ^(2.13.3) and later provides access to the hide function. | ^[object]`{hide: () => void}` |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/en-US/component/popover.md` at line 111, Update the slot description row for the "default" slot in popover docs: replace the phrase "can receive the hide parameter" with clearer wording that it "exposes a scoped slot prop `hide` (function)". Reference the "default" slot and the scoped slot prop name "hide" so readers understand it's a provided prop rather than an input parameter.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/en-US/component/popover.md`:
- Line 111: Update the slot description row for the "default" slot in popover
docs: replace the phrase "can receive the hide parameter" with clearer wording
that it "exposes a scoped slot prop `hide` (function)". Reference the "default"
slot and the scoped slot prop name "hide" so readers understand it's a provided
prop rather than an input parameter.
|
Shall I add a test case to this slot |
|
That would be better. |
keeplearning66
left a comment
There was a problem hiding this comment.
Thank you for your contribution! Based on the description in #23690, would directly using Popconfirm meet your needs?
I think popconfirm couldn't achieve my needs, it does provided Another reason to choose [popover] is that it offers more APIs. |
Thank you for your explanation. I just feel that the behavior of 'manually closing the popup through a button inside the popup' is more in line with |
keeplearning66
left a comment
There was a problem hiding this comment.
Okay, thank you for your patient explanation. Just need to update the version number.
Co-authored-by: keeplearning66 <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/en-US/component/popover.md (1)
109-112: Documentation accurately reflects the slot API changes.The Type column addition and slot documentation are correct. The type signature
{hide: () => void}matches the implementation, and version 2.13.4 aligns with the previous review discussion.Optional: Minor wording refinement for clarity
Consider adding backticks around
hidein the description for consistency with documentation conventions:-| default | content of popover, version ^(2.13.4) and later can receive the hide parameter. | ^[object]`{hide: () => void}` | +| default | content of popover, version ^(2.13.4) and later can receive the `hide` parameter. | ^[object]`{hide: () => void}` |Alternatively, for even more precision, you could rephrase to:
-| default | content of popover, version ^(2.13.4) and later can receive the hide parameter. | ^[object]`{hide: () => void}` | +| default | content of popover, version ^(2.13.4) and later exposes a `hide` function in the slot scope. | ^[object]`{hide: () => void}` |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/en-US/component/popover.md` around lines 109 - 112, Update the documentation table row for the "default" slot so the description uses backticks around the hide parameter (e.g., change "hide parameter" to "`hide` parameter") and ensure the Type column remains `^[object]`{hide: () => void}` to match the implementation and version note; edit the "default" row string in docs/en-US/component/popover.md where the slot is defined to apply this wording change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/en-US/component/popover.md`:
- Around line 109-112: Update the documentation table row for the "default" slot
so the description uses backticks around the hide parameter (e.g., change "hide
parameter" to "`hide` parameter") and ensure the Type column remains
`^[object]`{hide: () => void}` to match the implementation and version note;
edit the "default" row string in docs/en-US/component/popover.md where the slot
is defined to apply this wording change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f2e61976-3e8f-45e9-bcce-eac427c1d525
📒 Files selected for processing (1)
docs/en-US/component/popover.md
|
@ZacharyBear Thanks for your contribution! ❤️ |





Please make sure these boxes are checked before submitting your PR, thank you!
devbranch.close #23690
Summary by CodeRabbit
New Features
Documentation