-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
54 lines (48 loc) · 1.43 KB
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<script setup>
import { ID_INJECTION_KEY, ElDialog, ElButton } from 'element-plus'
import { useCartStore } from "@/store/cart";
import CartSidebar from "@/components/CartSidebar";
provide(ID_INJECTION_KEY, {
prefix: 100,
current: 0,
})
const cartStore = useCartStore();
function chooseLogin(navigate) {
cartStore.displaySignupPrompt = false;
navigate()
}
function continueWithoutLogin(callback) {
cartStore.displaySignupPrompt = false
}
cartStore.fetchCart();
</script>
<template>
<div>
<NuxtLoadingIndicator color="#ff7800" :height="3"/>
<ClientOnly>
<el-dialog
v-model="cartStore.displaySignupPrompt"
title="Join us!"
>
<span>Login to add and reserve items in your cart for a smooth checkout experience.</span>
<template #footer>
<span class="dialog-footer">
<el-button @click="continueWithoutLogin">Later</el-button>
<NuxtLink custom to="/login" v-slot="{ navigate }">
<el-button type="primary" @click="chooseLogin(navigate)">Login</el-button>
</NuxtLink>
</span>
</template>
</el-dialog>
<el-dialog
v-model="cartStore.displayOutOfStock"
title="Out of stock :("
>
<span>Sorry, we will be restocking this product soon. Thank you for your patience.</span>
</el-dialog>
</ClientOnly>
<NavigationBar/>
<NuxtPage/>
<CartSidebar/>
</div>
</template>