-
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 issues #2400
Changes from all commits
b8f097c
f78f240
b8b608e
14ff6f6
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> | ||
<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> | ||
|
@@ -37,6 +37,9 @@ const now = () => { | |
</script> | ||
|
||
<style scoped> | ||
.demo-date-picker { | ||
width: 280px; | ||
} | ||
Comment on lines
+40
to
+42
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 CSS variables for consistent sizing. To maintain consistent widths across all date picker components, consider defining the width value as a CSS variable. Here's how you could improve it: +<style>
+:root {
+ --tiny-date-picker-width: 280px;
+}
+</style>
+
<style scoped>
.demo-date-picker {
- width: 280px;
+ width: var(--tiny-date-picker-width);
} This would make it easier to maintain consistent sizing across all date picker instances and support theming.
|
||
.nowclass { | ||
display: inline-flex; | ||
height: 28px; | ||
|
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> | ||||||||||||||||||||||||||||||||||||||
<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 making the date picker responsive. While standardizing the width improves consistency, a fixed width of 280px might not be optimal for all screen sizes. Consider using responsive design principles. .demo-date-picker {
- width: 280px;
+ width: 100%;
+ max-width: 280px;
+ min-width: 200px;
} 📝 Committable suggestion
Suggested change
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 responsive design for different screen sizes. While standardizing the width to 280px across components is good for consistency, consider using responsive design patterns for better mobile support. Consider using CSS media queries for responsive behavior: .demo-date-picker {
width: 280px;
+ @media (max-width: 320px) {
+ width: 100%;
+ max-width: 280px;
+ }
} 📝 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 adding responsive width handling.
While standardizing the width is good, consider making the date picker more responsive to different screen sizes and device types. This would be particularly important when dealing with large numbers of alarms.
Consider updating the CSS to handle different viewport sizes:
📝 Committable suggestion