Skip to content

Commit

Permalink
fix: heading and data style when sortable (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-chase authored Feb 12, 2020
1 parent 2d20ff7 commit 59bd310
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/components/cv-data-table/cv-data-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,11 @@ export default {
computed: {
isSortable() {
return col => {
if (col && this.columns.some(column => column.sortable)) {
return col.sortable;
if (col) {
// specific column or all sortable
return (col && col.sortable) || this.sortable;
} else {
// is any column sortable
return this.sortable || this.columns.some(column => column.sortable);
}
};
Expand Down Expand Up @@ -441,6 +443,7 @@ export default {
watchColumns() {
this.dataColumns = this.isSortable
? this.columns.map(item => ({
...item,
label: item.label ? item.label : item,
order: 'none',
sortable: item.sortable,
Expand Down

0 comments on commit 59bd310

Please sign in to comment.