wip: shopping cart
This commit is contained in:
@@ -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}; // Или оставить на старте
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user