item.category = categories[index]) this.filteredProjects = projects }, loadCategoriesTaxonomy(){ let categories = [ {{ taxonomy:categories }} {{ title | to_json }}, {{ /taxonomy:categories }} ] this.categories = categories; }, filterProjects(category){ if(!category){ this.filteredProjects = this.projects; this.activeCategory = false; return; } let filterAlreadyActive = Array.isArray(this.activeCategory); let filters = filterAlreadyActive ? [...this.activeCategory, category] : [category]; this.filteredProjects = this.projects.filter((project) => filters.includes(project.category)); this.activeCategory = filters; }, removeFilter(category){ this.activeCategory = this.activeCategory.filter( item => item !== category) if(this.activeCategory.length === 0){ this.activeCategory = false; this.filteredProjects = this.projects; }else{ this.filteredProjects = this.projects.filter((project) => this.activeCategory.includes(project.category)); } } }' x-on:resize.window="width = window.innerWidth" >
{{ partial:page_information }}