This commit is contained in:
27
pages/cart.vue
Normal file
27
pages/cart.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div class="cart">
|
||||
<div v-if="cartProducts">
|
||||
{{ cartProducts }}
|
||||
</div>
|
||||
|
||||
<UButton @click="createOrder">
|
||||
Оформить заказ
|
||||
</UButton>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { usePostOrdersCreate } from '~/api/mutations'
|
||||
|
||||
const { getCart } = useCart()
|
||||
const cartProducts = getCart()
|
||||
const { mutateAsync } = usePostOrdersCreate()
|
||||
|
||||
const createOrder = () => {
|
||||
mutateAsync(cartProducts)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user