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

feat(Table): handle rowClass property in columns #1632

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

galexrt
Copy link
Contributor

@galexrt galexrt commented Apr 7, 2024

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This allows the columns list to specify a class to be set on the rows columns.

Implements the idea from my comment here: #527 (comment)

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

I could add more info to the documentation about this feature if wanted.

@@ -29,6 +29,7 @@ Use the `columns` prop to configure which columns to display. It's an array of o
- `sortable` - Whether the column is sortable. Defaults to `false`.
- `direction` - The sort direction to use on first click. Defaults to `asc`.
- `class` - The class to apply to the column cells.
Copy link
Member

Choose a reason for hiding this comment

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

Why not use the class field already dedicated to this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The class field only seems to be applied to the <th> of the column, if I use block lg:hidden there it will only hide the header and not the data cells <td>.
I would prefer having a way to add a class from the columns list instead of having to modify the rows I pass into the Table component to set classes on data cells.

This allows the columns list to specify a class to be set on the rows
columns.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
@benjamincanac benjamincanac changed the title feat(Table): add rowClass to columns list feat(Table): add rowClass property in columns Jul 23, 2024
@benjamincanac benjamincanac changed the title feat(Table): add rowClass property in columns feat(Table): handle rowClass property in columns Jul 23, 2024
@benjamincanac benjamincanac merged commit 748e491 into nuxt:dev Jul 23, 2024
1 check passed
binhtranhuu pushed a commit to binhtranhuu/nuxt-ui that referenced this pull request Jul 28, 2024
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants