@@ -14,6 +14,7 @@ import { useParentMixin } from '../../../mixins/use-parent'
1414import { get } from '../../../utils/get'
1515import { isFunction , isString , isUndefinedOrNull } from '../../../utils/inspect'
1616import { makeProp } from '../../../utils/props'
17+ import { safeVueInstance } from '../../../utils/safe-vue-instance'
1718import { toString } from '../../../utils/string'
1819import { BTr } from '../tr'
1920import { BTd } from '../td'
@@ -160,7 +161,7 @@ export const tbodyRowMixin = Vue.extend({
160161 }
161162 // If table supports selectable mode, then add in the following scope
162163 // this.supportsSelectableRows will be undefined if mixin isn't loaded
163- if ( this . supportsSelectableRows ) {
164+ if ( safeVueInstance ( this ) . supportsSelectableRows ) {
164165 slotScope . rowSelected = this . isRowSelected ( rowIndex )
165166 slotScope . selectRow = ( ) => this . selectRow ( rowIndex )
166167 slotScope . unselectRow = ( ) => this . unselectRow ( rowIndex )
@@ -193,13 +194,13 @@ export const tbodyRowMixin = Vue.extend({
193194 currentPage,
194195 perPage,
195196 tbodyTrClass,
196- tbodyTrAttr
197- } = this
197+ tbodyTrAttr,
198+ hasSelectableRowClick
199+ } = safeVueInstance ( this )
198200 const h = this . $createElement
199201 const hasDetailsSlot = this . hasNormalizedSlot ( SLOT_NAME_ROW_DETAILS )
200202 const rowShowDetails = item [ FIELD_KEY_SHOW_DETAILS ] && hasDetailsSlot
201- const hasRowClickHandler =
202- this . $listeners [ EVENT_NAME_ROW_CLICKED ] || this . hasSelectableRowClick
203+ const hasRowClickHandler = this . $listeners [ EVENT_NAME_ROW_CLICKED ] || hasSelectableRowClick
203204
204205 // We can return more than one TR if rowDetails enabled
205206 const $rows = [ ]
@@ -232,8 +233,12 @@ export const tbodyRowMixin = Vue.extend({
232233 const rowId = primaryKeyValue ? this . safeId ( `_row_${ primaryKeyValue } ` ) : null
233234
234235 // Selectable classes and attributes
235- const selectableClasses = this . selectableRowClasses ? this . selectableRowClasses ( rowIndex ) : { }
236- const selectableAttrs = this . selectableRowAttrs ? this . selectableRowAttrs ( rowIndex ) : { }
236+ const selectableClasses = safeVueInstance ( this ) . selectableRowClasses
237+ ? this . selectableRowClasses ( rowIndex )
238+ : { }
239+ const selectableAttrs = safeVueInstance ( this ) . selectableRowAttrs
240+ ? this . selectableRowAttrs ( rowIndex )
241+ : { }
237242
238243 // Additional classes and attributes
239244 const userTrClasses = isFunction ( tbodyTrClass ) ? tbodyTrClass ( item , 'row' ) : tbodyTrClass
@@ -282,7 +287,7 @@ export const tbodyRowMixin = Vue.extend({
282287 }
283288 // If table supports selectable mode, then add in the following scope
284289 // this.supportsSelectableRows will be undefined if mixin isn't loaded
285- if ( this . supportsSelectableRows ) {
290+ if ( safeVueInstance ( this ) . supportsSelectableRows ) {
286291 detailsScope . rowSelected = this . isRowSelected ( rowIndex )
287292 detailsScope . selectRow = ( ) => this . selectRow ( rowIndex )
288293 detailsScope . unselectRow = ( ) => this . unselectRow ( rowIndex )
0 commit comments