[Vuejs]-Reorder JSON objects array by specific key

0👍

This might help you:

transformModels(models) {
  const transformedModels = {};

  models.forEach(model => {
    if(!transformedModels[model.node]) {
         transformedModels[model.node] = []; 
    }
    transformedModels[model.node].push(model);
  });

  return transformedModels;
}

nodes = transformModels(models);

Leave a comment