Created
June 14, 2022 18:40
-
-
Save ilyasakin/d8df5515b728a65849c036fd0590e35f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
... | |
<Spinner :status="isLoading" /> | |
... | |
</template> | |
<script setup lang="ts"> | |
// imports ... | |
const isLoading = ref<boolean>(false); | |
const products = ref<IProduct[]>([]); | |
const cart = ref<ICartItem[]>([]); | |
const getProducts = async () => { | |
isLoading.value = true; | |
products.value = await productsService.getProducts(); | |
isLoading.value = false; | |
}; | |
const getCart = async () => { | |
isLoading.value = true; | |
cart.value = await cartService.getCartItems(); | |
isLoading.value = false; | |
}; | |
getProducts(); | |
getCart(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment