{
let columnsDesktop = $event.detail.colsDesktop;
let columnsMobile = $event.detail.colsMobile;
if(!columnsDesktop){
columnsDesktop = localStorage.getItem('columnsDesktop') || 4;
}
if(!columnsMobile){
columnsMobile = localStorage.getItem('columnsMobile') || 2;
}
if(window.matchMedia('(max-width: 679.5px)').matches){ // 679.5px to prevent overlapping with the mobile breakpoint
document.querySelector('#product-grid').style.gridTemplateColumns=`repeat(${columnsMobile},minmax(0,1fr)`;
} else {
document.querySelector('#product-grid').style.gridTemplateColumns=`repeat(${columnsDesktop},minmax(0,1fr)`;
}
// Persist on local storage
localStorage.setItem('columnsDesktop', columnsDesktop);
localStorage.setItem('columnsMobile', columnsMobile);
// Fire event
const gridColumnsUpdatedEvent = new CustomEvent('gridColumnsUpdated', {
detail: {
colsDesktop: columnsDesktop,
colsMobile: columnsMobile
}
});
window.dispatchEvent(gridColumnsUpdatedEvent);
})
"
@resize.window="
() => {
$dispatch('manage-grid-columns')
}
"
@set-columns="
$nextTick(() => {
this.selectedColumnsDesktop = localStorage.getItem('columnsDesktop') || 4;
this.selectedColumnsMobile = localStorage.getItem('columnsMobile') || 2;
})
"
>
No se encontraron productos
value !== 'baby-nino');
params.delete('filter.p.tag');
values.forEach(value => params.append('filter.p.tag', value));
} else {
params.append('filter.p.tag', 'baby-nino');
}
window.location.href = `${window.location.pathname}?${params.toString()}`;
"
class="category-btns button-outlined font-[400] !py-1.5 px-3 md:px-2 text-[12px] leading-[15.97p] md:text-[14px] md:h-fit"
:class="{'bg-grey-3 text-white ': new URLSearchParams(window.location.search).getAll('filter.p.tag').includes('baby-nino')}"
>BABY NIÑO
value !== 'baby-nina');
params.delete('filter.p.tag');
values.forEach(value => params.append('filter.p.tag', value));
} else {
params.append('filter.p.tag', 'baby-nina');
}
window.location.href = `${window.location.pathname}?${params.toString()}`;
"
class="category-btns button-outlined font-[400] !py-1.5 px-3 md:px-2 text-[12px] leading-[15.97p] md:text-[14px] md:h-fit"
:class="{'bg-grey-3 text-white ': new URLSearchParams(window.location.search).getAll('filter.p.tag').includes('baby-nina')}"
>BABY NIÑA
value !== 'mini-nino');
params.delete('filter.p.tag');
values.forEach(value => params.append('filter.p.tag', value));
} else {
params.append('filter.p.tag', 'mini-nino');
}
window.location.href = `${window.location.pathname}?${params.toString()}`;
"
class="category-btns button-outlined font-[400] !py-1.5 px-3 md:px-2 text-[12px] leading-[15.97p] md:text-[14px] md:h-fit"
:class="{'bg-grey-3 text-white ': new URLSearchParams(window.location.search).getAll('filter.p.tag').includes('mini-nino')}"
>MINI NIÑO
value !== 'mini-nina');
params.delete('filter.p.tag');
values.forEach(value => params.append('filter.p.tag', value));
} else {
params.append('filter.p.tag', 'mini-nina');
}
window.location.href = `${window.location.pathname}?${params.toString()}`;
"
class="category-btns button-outlined font-[400] !py-1.5 px-3 md:px-2 text-[12px] leading-[15.97p] md:text-[14px] md:h-fit"
:class="{'bg-grey-3 text-white ': new URLSearchParams(window.location.search).getAll('filter.p.tag').includes('mini-nina')}"
>MINI NIÑA
value !== 'kids-nino');
params.delete('filter.p.tag');
values.forEach(value => params.append('filter.p.tag', value));
} else {
params.append('filter.p.tag', 'kids-nino');
}
window.location.href = `${window.location.pathname}?${params.toString()}`;
"
class="category-btns button-outlined font-[400] !py-1.5 px-3 md:px-2 text-[12px] leading-[15.97p] md:text-[14px] md:h-fit"
:class="{'bg-grey-3 text-white ': new URLSearchParams(window.location.search).getAll('filter.p.tag').includes('kids-nino')}"
>KIDS NIÑO
value !== 'kids-nina');
params.delete('filter.p.tag');
values.forEach(value => params.append('filter.p.tag', value));
} else {
params.append('filter.p.tag', 'kids-nina');
}
window.location.href = `${window.location.pathname}?${params.toString()}`;
"
class="category-btns button-outlined font-[400] !py-1.5 px-3 md:px-2 text-[12px] leading-[15.97p] md:text-[14px] md:h-fit"
:class="{'bg-grey-3 text-white ': new URLSearchParams(window.location.search).getAll('filter.p.tag').includes('kids-nina')}"
>KIDS NIÑA