File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727
2828const sortedCategories = [' frontend' , ' tools' , ' backend' , ' other' ];
2929
30+ function getCategoryIndex (skill ) {
31+ return sortedCategories .indexOf (skill .catagory );
32+ }
33+
34+ function equalsCategory (skill , other ) {
35+ return getCategoryIndex (skill) === getCategoryIndex (other);
36+ }
37+
3038export default {
3139 name: ' outline' ,
3240 props: [' outline' ],
@@ -35,11 +43,12 @@ export default {
3543 if (! this .outline .skills ) {
3644 return [];
3745 }
46+
3847 return this .outline .skills .sort ((skill , other ) => {
39- if (sortedCategories . indexOf (skill . catagory ) !== sortedCategories . indexOf ( other . catagory )) {
40- return sortedCategories . indexOf ( skill . catagory ) - sortedCategories . indexOf (skill . catagory );
48+ if (equalsCategory (skill, other)) {
49+ return getCategoryIndex (other ) - getCategoryIndex (skill);
4150 }
42- other .level - skill .level ;
51+ return other .level - skill .level ;
4352 });
4453 }
4554 }
Original file line number Diff line number Diff line change 5454<script >
5555export default {
5656 data () {
57- console .log (' +++ data' , Number .POSITIVE_INFINITY );
58-
5957 return {
6058 tableOfContents: false ,
6159
@@ -67,7 +65,6 @@ export default {
6765 },
6866 methods: {
6967 setTableOfContents (value ) {
70- console .log (' +++ value' , value);
7168 this .tableOfContents = value;
7269 },
7370 },
@@ -301,7 +298,7 @@ export default {
301298 }
302299 }
303300
304- p {
301+ p , ul {
305302 margin-bottom : 0.5rem ;
306303 }
307304
You can’t perform that action at this time.
0 commit comments