-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Feature/data table striped #1591
Feature/data table striped #1591
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tusimple/naive-ui/GDJ6UXrjMU6GWGfVRMY7seBco4TQ |
cM('striped', [ | ||
cB('data-table-tr:nth-child(even)', [cB('data-table-td', 'background-color: var(--td-color-hover);')]) | ||
]), |
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.
In fact this is not the correct behavior since when table row is expandable, the even odd status of the row will be changed.
However it won't be hard since we can just follow the index to distinguish the row status.
Codecov Report
@@ Coverage Diff @@
## main #1591 +/- ##
=======================================
Coverage 64.26% 64.26%
=======================================
Files 885 885
Lines 17130 17130
Branches 4050 4050
=======================================
Hits 11008 11008
Misses 5382 5382
Partials 740 740
Continue to review full report at Codecov.
|
I'm wrong, actually the refactor is not easy. hahaha. See c522347 to know what is changed to make it work in all possible cases. |
* feat(data-table): striped data table. * test(data-table): add striped test, only checking class. * docs(CHANGELOG, demo): add en demo docs, add CHANGELOG Co-authored-by: 07akioni <07akioni2@gmail.com>
* feat(data-table): striped data table. * test(data-table): add striped test, only checking class. * docs(CHANGELOG, demo): add en demo docs, add CHANGELOG Co-authored-by: 07akioni <07akioni2@gmail.com>
implementation of #1552.
Something may need to be discussed:
var(--td-color-hover)
as stripe color.It's my first PR to open source community so if there's any problem just point it out and I'll fix it.