Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set "cursor" to "pointer" on Vuetify <v-data-table> rows?

Tags:

vuetify.js

How to set cursor: pointer on Vuetify <v-data-table> rows ?

I tried the code below in my component, but it's not recognized:

<style lang="css" scoped>
tr:hover {
  cursor: pointer;
}
</style>
like image 613
DevonDahon Avatar asked May 13 '20 22:05

DevonDahon


2 Answers

I finally fixed it this way:

</template>
<v-data-table class="row-pointer"></v-data-table>
<template>

<style lang="css" scoped>
.row-pointer >>> tbody tr :hover {
  cursor: pointer;
}
</style>
like image 50
DevonDahon Avatar answered Sep 20 '22 07:09

DevonDahon


This is how you can override the rows of v-data-table component with a custom css selector. The accepted answer only works in scoped stlyes.

<template>
  <v-data-table class="row-pointer" ...></v-data-table>
</template>

<style> 
.row-pointer > .v-data-table__wrapper > table > tbody > tr:hover {  
  cursor: pointer;
}
</style>
like image 28
Nesd Avatar answered Sep 20 '22 07:09

Nesd