@@ -309,15 +309,8 @@ export default {
309
309
col .classFooterName = field .classFooterName
310
310
}
311
311
312
- if (field .render ) {
313
- if (! field .render .templated ) {
314
- let myRender = field .render
315
- field .render = function () {
316
- return myRender .apply (that, Array .prototype .slice .call (arguments ))
317
- }
318
- }
319
-
320
- col .render = field .render
312
+ if (field .template ) {
313
+ col .template = field .template
321
314
}
322
315
323
316
// console.log(col)
@@ -378,7 +371,7 @@ export default {
378
371
if (startCol > 0 ) {
379
372
if (that .options .order ) {
380
373
that .options .order .forEach ((v ) => {
381
- v[0 ] += startCol
374
+ v[0 ] += startCol
382
375
})
383
376
} else {
384
377
that .options .order = [[startCol, ' asc' ]]
@@ -389,6 +382,28 @@ export default {
389
382
const that = this
390
383
const jq = that .jq
391
384
const $el = jq (that .$refs .table )
385
+ let cols = that .options .columns
386
+
387
+ for (let k in cols) {
388
+ const col = cols[k]
389
+
390
+ if (col .template || that .$scopedSlots [col .name ]) {
391
+ col .render = that .compileTemplate (col, that .$scopedSlots [col .name ])
392
+ }
393
+
394
+ if (col .render ) {
395
+ if (! col .render .templated ) {
396
+ let myRender = col .render
397
+ col .render = function () {
398
+ return myRender .apply (that, Array .prototype .slice .call (arguments ))
399
+ }
400
+ }
401
+ }
402
+
403
+ if (col .template ) {
404
+ delete col .template
405
+ }
406
+ }
392
407
393
408
// handle local data loader
394
409
if (that .dataLoader ) {
0 commit comments