fix(vnTable_order): default value
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2024-07-12 13:03:49 +02:00
parent 873d8ad2c3
commit 58d029c5bb
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
async function addOrder(field, direction = 'ASC') { async function addOrder(field, direction = 'ASC') {
const newOrder = field + ' ' + direction; const newOrder = field + ' ' + direction;
let order = store.order ?? []; let order = store.order || [];
if (typeof order == 'string') order = [order]; if (typeof order == 'string') order = [order];
let index = order.findIndex((o) => o.split(' ')[0] === field); let index = order.findIndex((o) => o.split(' ')[0] === field);