This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
import { createSharedComposable } from '@vueuse/core'
|
||||
import { createSharedComposable, useStorage } from '@vueuse/core'
|
||||
|
||||
export const useCheckout = createSharedComposable(() => {
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const contacts = useStorage('checkout-contacts', { name: '', surname: '', phone: '', email: '' })
|
||||
|
||||
const setContacts = (data: { name: string, surname: string, phone: string, email: string }) => {
|
||||
contacts.value = data
|
||||
}
|
||||
|
||||
const checkoutSteps = [
|
||||
{
|
||||
step: 1,
|
||||
@@ -41,6 +47,9 @@ export const useCheckout = createSharedComposable(() => {
|
||||
}
|
||||
|
||||
return {
|
||||
contacts,
|
||||
setContacts,
|
||||
|
||||
checkoutSteps,
|
||||
currentCheckoutStep,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user