@@ -61,15 +61,15 @@ export default {
61
61
}
62
62
}
63
63
} ,
64
- mounted ( ) {
64
+ beforeMount ( ) {
65
65
// Set up handlers
66
66
if ( this . selectable ) {
67
67
this . setSelectionHandlers ( true )
68
68
}
69
69
} ,
70
70
methods : {
71
71
isRowSelected ( idx ) {
72
- return this . selectedRows [ idx ]
72
+ return Boolean ( this . selectedRows [ idx ] )
73
73
} ,
74
74
rowSelectedClasses ( idx ) {
75
75
if ( this . selectable ) {
@@ -95,9 +95,10 @@ export default {
95
95
} ,
96
96
setSelectionHandlers ( on ) {
97
97
const method = on ? '$on' : '$off'
98
+ // Handle row-clicked event
98
99
this [ method ] ( 'row-clicked' , this . selectionHandler )
100
+ // Clear selection on filter, pagination, and sort changes
99
101
this [ method ] ( 'filtered' , this . clearSelected )
100
- this [ method ] ( 'sort-changed' , this . clearSelected )
101
102
this [ method ] ( 'context-changed' , this . clearSelected )
102
103
} ,
103
104
selectionHandler ( item , index , evt ) {
@@ -119,7 +120,7 @@ export default {
119
120
idx <= Math . max ( this . selectedLastClicked , index ) ;
120
121
idx ++
121
122
) {
122
- // this.selectedRows[idx ] = true
123
+ // this.selectedRows[index ] = true
123
124
this . $set ( this . selectedRows , index , true )
124
125
}
125
126
selected = true
0 commit comments