File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export default {
2121
2222<template >
2323 <select
24- @change =" $emit('change ', $event.target.value)"
24+ @change =" $emit('filter ', $event.target.value)"
2525 :name =" select"
2626 :id =" select"
2727 class =" font-general-medium
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ export default {
1010 return {
1111 projects,
1212 projectsHeading: ' Projects Portfolio' ,
13- selectedProject : ' ' ,
13+ selectedCategory : ' ' ,
1414 searchProject: ' ' ,
1515 };
1616 },
1717 computed: {
1818 // Get the filtered projects
1919 filteredProjects () {
20- if (this .selectedProject ) {
20+ if (this .selectedCategory ) {
2121 return this .filterProjectsByCategory ();
2222 } else if (this .searchProject ) {
2323 return this .filterProjectsBySearch ();
@@ -28,12 +28,12 @@ export default {
2828 methods: {
2929 // Filter projects by category
3030 filterProjectsByCategory () {
31- return this .projects .map ((item ) => {
31+ return this .projects .filter ((item ) => {
3232 let category =
3333 item .category .charAt (0 ).toUpperCase () +
3434 item .category .slice (1 );
3535 console .log (category);
36- return category .includes (this .selectedProject );
36+ return category .includes (this .selectedCategory );
3737 });
3838 },
3939 // Filter projects by title search
@@ -127,7 +127,7 @@ export default {
127127 aria-label =" Name"
128128 />
129129 </div >
130- <ProjectsFilter @change = " selectedProject = $event" />
130+ <ProjectsFilter @filter = " selectedCategory = $event" />
131131 </div >
132132 </div >
133133
You can’t perform that action at this time.
0 commit comments