File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -193,10 +193,20 @@ export default defineComponent({
193193 * The data filtered by search text
194194 */
195195 dataFiltered ( ) {
196- const { data, searchableColumns, search } = this
196+ const { searchableColumns, search } = this
197+
198+ // assign key to track row
199+ const data = this . data . map ( ( value , index ) => {
200+ return {
201+ ...( value as Object ) ,
202+ _key : index ,
203+ } ;
204+ } )
205+
197206 if ( isNullable ( search ) ) {
198207 return data
199208 }
209+
200210 return data . filter ( function ( row : any ) {
201211 return searchableColumns . some ( function ( column : Column ) {
202212 return column . searchFunction ( row , search , column . key )
Original file line number Diff line number Diff line change 4040 </tr >
4141
4242 <!-- NON-EMPTY BODY -->
43- <tr v-for =" (data, i) in dataDisplayed" :key =" i" >
44- <td v-for =" (column, j) in columns" :key =" j" >
45- <component :is =" column.component"
46- v-bind =" { data, ...column.componentProps }"
47- @userEvent =" emitUserEvent" />
43+ <tr v-for =" data in dataDisplayed" :key =" data._key" >
44+ <keep-alive >
45+ <td v-for =" (column, j) in columns"
46+ :key =" 'c' + data._key + 'c' + j"
47+ >
48+ <component
49+ :is =" column.component"
50+ v-bind =" { data, ...column.componentProps }"
51+ @userEvent =" emitUserEvent" />
4852 </td >
53+ </keep-alive >
4954 </tr >
5055 </tbody >
5156
You can’t perform that action at this time.
0 commit comments