fix: layouts

This commit is contained in:
2026-03-24 12:26:23 +01:00
parent 78b32cbd9c
commit 0cee3e5cb7
16 changed files with 224 additions and 161 deletions

40
bo/src/stores/category.ts Normal file
View File

@@ -0,0 +1,40 @@
import { defineStore } from "pinia";
import { ref } from "vue";
const products = [
{name: "product name", price: 342432},
{name: "product name", price: 342432},
{name: "product name", price: 342432},
{name: "product name", price: 342432},
{name: "product name", price: 342432},
]
// type CategoryProducts = {}
export const useCategoryStore = defineStore('category', () => {
const id_category = ref(0)
const categoryProducts = ref(products)
function setCategoryID(id: number) {
id_category.value = id
}
async function getCategoryProducts() {
return new Promise<typeof products>((resolve) => {
setTimeout(() => {
console.log('Fetching products from category id: ', id_category.value);
resolve(categoryProducts.value)
}, 2000 * Math.random())
})
}
return {
id_category,
getCategoryProducts,
setCategoryID
}
})