Vue.component('results', { template: '#results-template', props: ['results', 'cols','sort_by','order_desc'], methods: { sortBy: function(col) { } } }); Vue.component('result-cell', { render: function(h) { return h('td', this.cellContent(h)); }, props: ['item', 'col'], methods: { bookUrl: function(id) { return '/books/' + id; }, authorUrl: function(id) { return '/authors/' + id; }, seriesUrl: function(id) { return '/series/' + id; }, link: function(h, icon, text, url) { return [ h('span',{ attrs: { class: 'glyphicon glyphicon-'+icon } },''), ' ', h('a', { attrs: { href: url } }, text) ]; }, badge: function(h, num) { return h('span', { attrs: { class: 'badge' } }, num); }, cellContent: function(h) { switch (this.col.id) { case 'name': return this.link(h, 'user', this.item.name, this.authorUrl(this.item.id)); case 'count': return this.item.count; case 'title': return this.link(h, 'book', this.item.title, this.bookUrl(this.item.id)); case 'authors': var elts = []; var authors = this.item.authors; for (i=0;i