export default {
template: `
`,
data() {
return {
activeSort: null
};
},
beforeMount() {},
mounted() {
this.params.column.addEventListener('sortChanged', this.onSortChanged);
this.onSortChanged();
},
methods: {
onSortChanged() {
this.activeSort = null;
if (this.params.column.isSortAscending()) {
this.activeSort = 'asc';
} else if (this.params.column.isSortDescending()) {
this.activeSort = 'desc';
}
},
onSortRequested(order, event) {
if (!this.params.enableSorting) return;
this.params.setSort(order, event.shiftKey);
}
}
};