How can we add sorting for multiple table heading in vue js? Present status: Sorting is working for firstname only. orderBy 'firstname' order Is it possible to sort more heading like orderBy 'firstname' 'lastname' 'email' order. It's a part of laravel based project. Any help will be greatly appreciated.
Table head
<th v-for="key in columns" @click="order = order * -1" :class="{active: sortKey == key}">@{{ colTitles[key] }}</th>
Table raw
<tr v-for="(index, item) in items | orderBy 'firstname' order">
<td>@{{ item.erp_id }}</td>
<td>@{{item.firstname}}</td>
<td><a href="{{ url('/customer/details/') }}/@{{ item.id }}">@{{item.lastname}}</a></td>
<td>@{{item.email}}</td>
<td>@{{item.phone_1}}</td>
<td>@{{item.status}}</td>
<td>@{{item.created_on}}</td>
</tr>
js
data: {
sortKey: '',
order: 1,
columns: ['erp_id', 'firstname', 'lastname', 'email', 'phone_1', 'status', 'created_on'],
colTitles: {'erp_id':'@lang('messages.customerListPageTableCustomerNo')', 'firstname':'@lang('messages.customerListPageTableFirstname')', 'lastname':'@lang('messages.customerListPageTableLastname')', 'email':'E-Mail', 'phone_1':'@lang('messages.customerListPageTablePhone')', 'status':'Status', 'created_on':'@lang('messages.customerListPageTableAddedDate')'},
}