Skip to content
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(drawer): [drawer] modify demo #2420

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/sites/demos/apis/drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {
'en-US': ''
},
mode: ['pc', 'mobile-first'],
pcDemo: 'Show bottom or not',
pcDemo: 'footer-slot',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add missing English description for show-footer property.

While the pcDemo value now correctly references the 'footer-slot' demo, the English description ('en-US') for the show-footer property is missing.

Add the English description to maintain documentation consistency:

desc: {
  'zh-CN': '是否显示底部',
-  'en-US': ''
+  'en-US': 'Whether to display the footer'
},

Committable suggestion was skipped due to low confidence.

mfDemo: ''
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const width = ref('900px')

function openDrawer0() {
visible.value = true
width.value = '900px'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix inconsistent state update order in openDrawer0.

The width update in openDrawer0 occurs after setting visibility, while other methods set width before visibility. This inconsistency could cause visual flickering.

Apply this diff to maintain consistent state update order:

function openDrawer0() {
-  visible.value = true
  width.value = '900px'
+  visible.value = true
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
width.value = '900px'
function openDrawer0() {
width.value = '900px'
visible.value = true
}

}

function openDrawer1() {
Expand Down
1 change: 1 addition & 0 deletions examples/sites/demos/pc/app/drawer/width.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default {
methods: {
openDrawer0() {
this.visible = true
this.width = '900px'
},
Comment on lines 29 to 31
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix inconsistent width setting order in openDrawer0.

The current implementation sets the width after making the drawer visible, which differs from openDrawer1 and openDrawer2. This could cause a visual "jump" as the drawer initially opens with the default width before applying the new width.

Apply this diff to maintain consistency with other methods and prevent potential visual artifacts:

     openDrawer0() {
-      this.visible = true
       this.width = '900px'
+      this.visible = true
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
this.visible = true
this.width = '900px'
},
this.width = '900px'
this.visible = true
},

openDrawer1() {
this.width = '700px'
Expand Down
Loading