wip: shopping cart

This commit is contained in:
Nikita Kiselev
2025-07-23 18:40:57 +03:00
parent bb2ee38118
commit 49d41747d3
22 changed files with 545 additions and 141 deletions

View File

@@ -4,23 +4,19 @@ import Product from './views/Product.vue';
import CategoriesList from "./views/CategoriesList.vue";
import Cart from "./views/Cart.vue";
import Products from "@/views/Products.vue";
import Checkout from "@/views/Checkout.vue";
const routes = [
{path: '/', name: 'home', component: Home},
{path: '/product/:id', name: 'product.show', component: Product},
{path: '/products/:category_id', name: 'product.categories.show', component: Products},
{path: '/categories', name: 'categories', component: CategoriesList},
{path: '/category/:id', name: 'category.show', component: Products},
{path: '/category/:id', name: 'category.show', component: CategoriesList},
{path: '/cart', name: 'cart.show', component: Cart},
{path: '/checkout', name: 'checkout', component: Checkout},
];
export const router = createRouter({
history: createMemoryHistory('/image/catalog/tgshopspa/'),
routes,
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition; // Восстановить позицию прокрутки
} else {
return {top: 0}; // Или оставить на старте
}
}
});