File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 5
5
target =" _blank"
6
6
rel =" noopener noreferrer"
7
7
:title =" link.title"
8
- >{{ link.platform }}</a
8
+ >{{ link.title }}</a
9
9
>
10
10
</li >
11
11
</template >
Original file line number Diff line number Diff line change @@ -345,18 +345,26 @@ export default {
345
345
if (websites === undefined ) {
346
346
return [];
347
347
}
348
- let linkData = websites .map ((obj ) =>
349
- Object .fromEntries (
350
- Object .entries (obj).filter (([key ]) => key === " fields" ),
351
- ),
352
- );
348
+ console .log (websites);
349
+ let linkData = websites
350
+ .map ((obj ) =>
351
+ Object .fromEntries (
352
+ Object .entries (obj).filter (([key ]) => key === " fields" ),
353
+ ),
354
+ )
355
+ .sort ((a , b ) => {
356
+ const platformA = a .fields .platform .toUpperCase ();
357
+ const platformB = b .fields .platform .toUpperCase ();
358
+ return platformA .localeCompare (platformB);
359
+ });
353
360
354
361
linkData = linkData .map ((item ) => {
355
362
return {
356
- title: ` ${ item .fields .title } - ${ item .fields .platform . charAt ( 0 ). toUpperCase () + item . fields . platform . slice ( 1 ) } ` ,
363
+ title: ` ${ item .fields .platform } - ${ item .fields .title } ` ,
357
364
url: item .fields .url ,
358
365
};
359
366
});
367
+ console .log (linkData);
360
368
return linkData;
361
369
},
362
370
},
You can’t perform that action at this time.
0 commit comments