Files
interview-demo-code/spa/src/views/Home.vue
2025-07-21 13:55:08 +03:00

25 lines
637 B
Vue

<template>
<div ref="goodsRef">
<CategoriesInline/>
<ProductsList
:products="productsStore.homeProducts.data"
:meta="productsStore.homeProducts.meta"
:isLoading="productsStore.isLoading"
/>
</div>
</template>
<script setup>
import {ref} from "vue";
import ProductsList from "@/components/ProductsList.vue";
import CategoriesInline from "../components/CategoriesInline.vue";
import {useProductsStore} from "@/stores/ProductsStore.js";
const productsStore = useProductsStore();
const goodsRef = ref();
function scrollToProducts() {
goodsRef.value?.scrollIntoView({ behavior: 'smooth' });
}
</script>