File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
src/components/table/helpers Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -24,13 +24,12 @@ export default {
2424 // `this.$refs.itemRows` is an array of item TR components/elements
2525 // Rows should all be B-TR components, but we map to TR elements
2626 // Also note that `this.$refs.itemRows` may not always be in document order
27- const tbody = this . $refs . tbody . $el || this . $refs . tbody
28- const trs = ( this . $refs . itemRows || [ ] ) . map ( tr => tr . $el || tr )
29- // TODO: This may take time for tables many rows, so we may want to cache
30- // the result of this during each render cycle on a non-reactive
31- // property. We clear out the cache as each render starts, and
32- // populate it on first access of this method if null
33- return arrayFrom ( tbody . children ) . filter ( tr => arrayIncludes ( trs , tr ) )
27+ const refs = this . $refs || { }
28+ const tbody = refs . tbody ? refs . tbody . $el || refs . tbody : null
29+ const trs = ( refs . itemRows || [ ] ) . map ( tr => tr . $el || tr )
30+ return tbody && trs . length
31+ ? arrayFrom ( tbody . children ) . filter ( tr => arrayIncludes ( trs , tr ) )
32+ : [ ]
3433 } ,
3534 getTbodyTrIndex ( el ) {
3635 // Returns index of a particular TBODY item TR
You can’t perform that action at this time.
0 commit comments