-
Notifications
You must be signed in to change notification settings - Fork 266
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(dialog-box): [dialog-box] destoryOnClose transition #2074
Conversation
WalkthroughThe changes refine the dialog box component by simplifying state management and enhancing rendering logic. Key updates include the removal of logic that resets the internal state key upon closing the dialog, the introduction of a Changes
Possibly related PRs
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 (
|
[e2e-test-warn] The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug". Please make sure you've read our contributing guide |
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- packages/renderless/src/dialog-box/index.ts (3 hunks)
- packages/renderless/src/dialog-box/vue.ts (2 hunks)
- packages/renderless/types/dialog-box.type.ts (1 hunks)
- packages/theme/src/dialog-box/index.less (9 hunks)
- packages/vue/src/dialog-box/src/pc.vue (2 hunks)
Files skipped from review due to trivial changes (1)
- packages/theme/src/dialog-box/index.less
Additional comments not posted (6)
packages/renderless/types/dialog-box.type.ts (1)
64-64
: Approved: Addition ofrender
property toIDialogBoxState
.The addition of the optional
render
property enhances state management by potentially allowing more granular control over the dialog box's rendering behavior. Ensure that this new property is utilized appropriately in the component's logic.Run the following script to verify the usage of the
render
property:packages/vue/src/dialog-box/src/pc.vue (2)
37-37
: Approved: Conditional rendering based onstate.render
.The introduction of
v-if="state.render"
in the dialog box content section is a good use of the newrender
state property, enhancing control over rendering based on the component's internal state.
22-22
: Approved: Flexible transition naming.The update to allow
dialogTransition || state.animationname
provides flexibility in managing animations, enhancing the component's responsiveness to different animation requirements.packages/renderless/src/dialog-box/vue.ts (2)
86-86
: Approved: Settingrender
based onprops.destroyOnClose
.The initialization of the
render
property in theinitState
function based onprops.destroyOnClose
is a logical use of the new property, aligning with the component's lifecycle requirements.
148-148
: Approved: Enhanced lifecycle management inafterLeave
.The inclusion of
state
andprops
in theafterLeave
function call enhances lifecycle management by allowing more nuanced behavior during the component's exit animation.packages/renderless/src/dialog-box/index.ts (1)
91-91
: Approved: Explicit management of rendering state.The addition of
state.render = true
when the dialog is opened is a clear and effective way to manage the component's visibility. Ensure that this change integrates well with other parts of the system, particularly with state management and event handling.Run the following script to verify the integration with other parts of the system:
Verification successful
Integration of
state.render = true
is consistent with existing patterns.The use of
state.render = true
in thedialog-box
component aligns with the existing pattern of managing rendering states across the codebase. No conflicts or improper handling were found in other parts of the system.
- Ensure that this change continues to align with the overall state management strategy.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration of `state.render = true` with other parts of the system. # Test: Search for the usage of `state.render` in other parts of the system. Expect: Proper handling and no conflicts. rg --type typescript -A 5 $'state.render'Length of output: 75
Script:
#!/bin/bash # Description: Verify the integration of `state.render = true` with other parts of the system. # Test: Search for the usage of `state.render` in other parts of the system. Expect: Proper handling and no conflicts. rg --type ts -A 5 $'state.render'Length of output: 11417
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/renderless/src/dialog-box/index.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/renderless/src/dialog-box/index.ts
@@ -107,10 +107,6 @@ export const watchVisible = | |||
emit('close') | |||
} | |||
|
|||
if (props.destroyOnClose) { |
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.
这段逻辑删除,可能会影响destroyOnClose属性的功能
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.
我重新开一个PR吧,这个PR有些太久远了
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #2045
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
Style