forked from COPS-CSOC-2022/csoc-week3-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.vue
71 lines (66 loc) · 1.71 KB
/
index.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<template>
<main class="max-w-lg mx-auto items-center justify-center px-2">
<div class="bg-white px-6 py-8 rounded shadow-md text-black w-full">
<h1 class="mb-8 text-3xl text-center">Login</h1>
<label for="inputUsername">
<input
id="inputUsername"
type="text"
class="block border border-grey-light w-full p-3 rounded mb-4"
name="inputUsername"
placeholder="Username"
/>
</label>
<label for="password">
<input
id="inputPassword"
type="password"
class="block border border-grey-light w-full p-3 rounded mb-4"
name="inputPassword"
placeholder="Password"
/>
</label>
<button
type="submit"
class="
w-full
text-center
py-3
rounded
bg-transparent
text-green-500
hover:text-white hover:bg-green-500
border border-green-500
hover:border-transparent
focus:outline-none
my-1
"
@click="login"
>
Login
</button>
</div>
</main>
</template>
<script>
import { useContext } from '@nuxtjs/composition-api'
import { defineComponent } from '@vue/composition-api'
export default defineComponent({
setup() {
const { $toast } = useContext()
function login() {
$toast.info('Complete Me!')
/***
* @todo Complete this function.
* @todo 1. Write code for form validation.
* @todo 2. Fetch the auth token from backend and login the user.
* @todo 3. Commit token to Vuex Store
* @hints checkout register/index.vue
*/
}
return {
login,
}
},
})
</script>