-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
[Documentation] Provide additional documentation for VDataTable header slot and show sort icon on hover #18628
Comments
I don't know if this will help you, but this is how I'm using sorting on mobile devices. And yes, it was hell to find out how to do it.
|
thanks for your reply. This is kind of the same answer as here, but still this doesn't cover the hover effect like you have with the default behavior (see image below). |
Same concept as both of those, just stick a v-hover around it and hide/show the icon. <template v-for="column in columns" :key="column.key">
<v-hover>
<template v-slot:default="{ isHovering, props }">
<td v-bind="props">
<span
class="mr-2 cursor-pointer"
:class="isHovering ? '' : 'pr-6'"
@click="() => toggleSort(column)"
>{{ column.title }}</span>
<v-icon
v-show="isSorted(column) || isHovering"
:icon="getSortIcon(column)"
></v-icon>
</td>
</template>
</v-hover>
</template> Mashing hover into this particular example gets kinda janky with the remove column icons being there. The sorting itself is still there the icon just pops up when it is sorted by clicking the header instead of on hover. If you have any additional questions, please reach out to us in our Discord community |
Problem to solve
As stated here within the docs:
I just don't know how to show the sort icon on hover the VDataTable header. Like the default functionality.
Proposed solution
Update the example to include this functionality.
The text was updated successfully, but these errors were encountered: