11<template >
22 <v-row justify =" center" align =" center" >
3- <v-col cols =" 12" sm =" 12" md =" 10 " lg =" 8" >
3+ <v-col cols =" 12" sm =" 12" md =" 12 " lg =" 8" >
44 <v-card :disabled =" loading" >
55 <v-card-title >
66 <v-text-field
1717 :items =" classes"
1818 item-key =" crn"
1919 sort-by =" semster_index"
20- :dense =" true "
20+ :dense =" false "
2121 :loading =" loading"
2222 group-by =" semster_index"
2323 class =" elevation-1"
2424 :search =" search"
2525 show-group-by
26- ></v-data-table >
26+ >
27+ <template v-slot :item .days =" { item } " >
28+ <v-chip v-for =" day in item.days" :key =" day" >
29+ {{ daysNames[day] }}
30+ </v-chip >
31+ </template >
32+
33+ <template v-slot :item .button =" { item } " >
34+ <v-tooltip top :color =" item.buttonOptions.color" >
35+ <template v-slot :activator =" { on , attrs } " >
36+ <v-btn
37+ elevation =" 2"
38+ :color =" item.buttonOptions.color"
39+ :disabled =" item.buttonOptions.disabled"
40+ v-bind =" attrs"
41+ v-on =" on"
42+ fab
43+ small
44+ @click =" $emit('class:action', item)"
45+ >
46+ <v-icon > mdi-plus </v-icon >
47+ </v-btn >
48+ </template >
49+ <div v-for =" tooltip in item.buttonOptions.tooltips" >
50+ {{ tooltip }}
51+ </div >
52+ </v-tooltip >
53+ </template >
54+ </v-data-table >
2755 </v-card >
2856 </v-col >
2957 </v-row >
3058</template >
3159
3260<script >
3361export default {
62+ emits: [' class:action' ],
3463 props: {
3564 classes: { type: Array , default: {} },
3665 loading: { type: Boolean , default: false },
3766 },
3867 data () {
3968 return {
4069 search: ' ' ,
70+ daysNames: {
71+ 1 : ' Sun' ,
72+ 2 : ' Mon' ,
73+ 3 : ' Tue' ,
74+ 4 : ' Wed' ,
75+ 5 : ' Thu' ,
76+ 6 : ' Fri' ,
77+ 7 : ' Sat' ,
78+ },
4179 headers: [
4280 { text: ' Course Name' , align: ' start' , value: ' name' },
4381 { text: ' Code' , value: ' code' , align: ' right' , groupable: false },
@@ -47,6 +85,7 @@ export default {
4785 { text: ' time' , value: ' time' , align: ' right' , groupable: false },
4886 { text: ' Instructor' , value: ' instructor' , align: ' right' },
4987 { text: ' Semster' , value: ' semster_index' , align: ' right' },
88+ { text: ' button' , value: ' button' , align: ' right' , groupable: false },
5089 ],
5190 }
5291 },
0 commit comments