-
Notifications
You must be signed in to change notification settings - Fork 276
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
feat(date-picker): [date-picker]Optimize case display and fix style i… #2386
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,6 @@ const value = ref('') | |
|
||
<style scoped> | ||
.demo-date-picker-wrap { | ||
width: 350px; | ||
width: 280px; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,6 @@ export default { | |
|
||
<style scoped> | ||
.demo-date-picker-wrap { | ||
width: 350px; | ||
width: 280px; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,6 @@ | ||||||||||||||||||
<template> | ||||||||||||||||||
<div> | ||||||||||||||||||
<div style="width: 400px"> | ||||||||||||||||||
<div class="demo-date-picker"> | ||||||||||||||||||
<div class="title">插槽式:</div> | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider using i18n for text content. The hardcoded Chinese text could be moved to translation files for better internationalization support. - <div class="title">插槽式:</div>
+ <div class="title">{{ $t('datePicker.slotMode') }}</div>
- <div class="title">函数式:</div>
+ <div class="title">{{ $t('datePicker.functionMode') }}</div> Also applies to: 13-13 |
||||||||||||||||||
<tiny-date-picker v-model="value1" type="datetime"> | ||||||||||||||||||
<template #now> | ||||||||||||||||||
|
@@ -9,7 +9,7 @@ | |||||||||||||||||
</tiny-date-picker> | ||||||||||||||||||
</div> | ||||||||||||||||||
|
||||||||||||||||||
<div style="width: 400px"> | ||||||||||||||||||
<div class="demo-date-picker"> | ||||||||||||||||||
<div class="title">函数式:</div> | ||||||||||||||||||
<tiny-date-picker v-model="value2" type="datetime" :now-click="nowClick"> </tiny-date-picker> | ||||||||||||||||||
</div> | ||||||||||||||||||
|
@@ -45,6 +45,9 @@ export default { | |||||||||||||||||
</script> | ||||||||||||||||||
|
||||||||||||||||||
<style scoped> | ||||||||||||||||||
.demo-date-picker { | ||||||||||||||||||
width: 280px; | ||||||||||||||||||
} | ||||||||||||||||||
Comment on lines
+48
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider adding responsive width handling. The style implementation is clean and properly scoped. However, consider making the width responsive using min-width or max-width constraints to better handle different screen sizes and content lengths. Here's a suggested improvement: .demo-date-picker {
- width: 280px;
+ width: 100%;
+ max-width: 280px;
+ min-width: 240px;
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||
.nowclass { | ||||||||||||||||||
display: inline-flex; | ||||||||||||||||||
height: 28px; | ||||||||||||||||||
|
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.
🛠️ Refactor suggestion
Consider making the width configurable.
While the fixed width works for the current use case, consider making it more flexible for better reusability:
This allows overriding the width through CSS variables when needed while maintaining the default width.
📝 Committable suggestion