1
1
<template >
2
- <div >
3
- create component
4
- </div >
2
+ <AppLayout title =" Create user" >
3
+
4
+ <template #header >
5
+ <h2 class =" font-semibold text-xl text-gray-800 leading-tight" >
6
+ Create user
7
+ </h2 >
8
+ </template >
9
+
10
+ <div class =" py-12" >
11
+ <div class =" max-w-7xl mx-auto sm:px-6 lg:px-8" >
12
+ <div class =" m-auto w-full max-w-xs" >
13
+
14
+ <form @submit.prevent =" submit" class =" bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4 m-auto" >
15
+
16
+ <div class =" mb-4" >
17
+ <label class =" block text-gray-700 text-sm font-bold mb-2" for =" name" >
18
+ Name <span class =" text-red-500" >*</span >
19
+ </label >
20
+ <input v-model =" form.name"
21
+ class =" mb-2 shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
22
+ id =" name" type =" text" >
23
+ <!-- <span class="text-red-500">{{ errors.name }}</span> -->
24
+ </div >
25
+
26
+ <div class =" mb-4" >
27
+ <label class =" block text-gray-700 text-sm font-bold mb-2" for =" email" >
28
+ E-mail <span class =" text-red-500" >*</span >
29
+ </label >
30
+ <input v-model =" form.email"
31
+ class =" mb-2 shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
32
+ id =" email" type =" email" >
33
+ <!-- <span class="text-red-500">{{ errors.email }}</span> -->
34
+ </div >
35
+
36
+ <div class =" mb-4" >
37
+ <div class =" mb-3 xl:w-96" >
38
+ <select disabled v-model =" form.role_id"
39
+ class =" form-select appearance-none block text-base font-normal text-gray-700 bg-white bg-clip-padding bg-no-repeat border border-solid border-gray-300 rounded ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none"
40
+ aria-label =" Default select example" >
41
+ <option value =" 2" >Subscriber</option >
42
+ </select >
43
+ </div >
44
+ </div >
45
+
46
+ <div class =" mb-4" >
47
+ <label class =" block text-gray-700 text-sm font-bold mb-2" for =" password" >
48
+ Password <span class =" text-red-500" >*</span >
49
+ </label >
50
+ <input v-model =" form.password"
51
+ class =" mb- 2shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
52
+ id =" password" type =" password" >
53
+ <!-- <span class="text-red-500">{{ errors.password }}</span> -->
54
+ </div >
55
+
56
+ <div class =" flex items-center justify-between" >
57
+ <Button :form =" form" ></Button >
58
+ </div >
59
+ </form >
60
+
61
+ <p class =" text-center text-gray-500 text-xs" >
62
+ © ; 2023 - <a class =" text-blue-500" href =" https://github.com/perisicnikola37"
63
+ target =" _blank" >@perisicnikola37</a >
64
+ </p >
65
+ </div >
66
+ </div >
67
+ </div >
68
+ </AppLayout >
5
69
</template >
6
70
71
+
7
72
<script >
8
- export default {
73
+ import AppLayout from ' @/Layouts/AppLayout.vue' ;
74
+ import Button from ' @/Components/Button.vue' ;
9
75
76
+ export default {
77
+ components: {
78
+ AppLayout,
79
+ Button
80
+ },
81
+ data () {
82
+ return {
83
+ form: this .$inertia .form ({
84
+ name: ' ' ,
85
+ email: ' ' ,
86
+ role_id: 1 ,
87
+ password: ' ' ,
88
+ })
89
+ }
90
+ },
91
+ methods: {
92
+ submit () {
93
+ this .form .post (this .route (' users.store' ), {
94
+ _token: this .$page .props .csrf_token ,
95
+ });
96
+ }
97
+ }
10
98
}
11
99
</script >
0 commit comments