File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default {
21
21
22
22
<template >
23
23
<select
24
- @change =" $emit('change ', $event.target.value)"
24
+ @change =" $emit('filter ', $event.target.value)"
25
25
:name =" select"
26
26
:id =" select"
27
27
class =" font-general-medium
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ export default {
10
10
return {
11
11
projects,
12
12
projectsHeading: ' Projects Portfolio' ,
13
- selectedProject : ' ' ,
13
+ selectedCategory : ' ' ,
14
14
searchProject: ' ' ,
15
15
};
16
16
},
17
17
computed: {
18
18
// Get the filtered projects
19
19
filteredProjects () {
20
- if (this .selectedProject ) {
20
+ if (this .selectedCategory ) {
21
21
return this .filterProjectsByCategory ();
22
22
} else if (this .searchProject ) {
23
23
return this .filterProjectsBySearch ();
@@ -28,12 +28,12 @@ export default {
28
28
methods: {
29
29
// Filter projects by category
30
30
filterProjectsByCategory () {
31
- return this .projects .map ((item ) => {
31
+ return this .projects .filter ((item ) => {
32
32
let category =
33
33
item .category .charAt (0 ).toUpperCase () +
34
34
item .category .slice (1 );
35
35
console .log (category);
36
- return category .includes (this .selectedProject );
36
+ return category .includes (this .selectedCategory );
37
37
});
38
38
},
39
39
// Filter projects by title search
@@ -127,7 +127,7 @@ export default {
127
127
aria-label =" Name"
128
128
/>
129
129
</div >
130
- <ProjectsFilter @change = " selectedProject = $event" />
130
+ <ProjectsFilter @filter = " selectedCategory = $event" />
131
131
</div >
132
132
</div >
133
133
You can’t perform that action at this time.
0 commit comments