Blame view
src/pages/Login.vue
3.73 KB
93a68cfa1
|
1 2 3 4 5 6 7 8 9 10 11 12 |
<template> <v-app id="login"> <v-toolbar color="grey lighten"> <v-toolbar-items> <img src="/static/ana@2x.png" height="36" alt="ana"> </v-toolbar-items> </v-toolbar> <v-content> <v-container fluid fill-height> <v-layout align-center justify-center> |
04e3fbc56
|
13 |
<v-flex xs12 sm8 md6 lg5> |
07095d4d8
|
14 15 |
<v-toolbar color="black" dark> <v-spacer></v-spacer> |
93a68cfa1
|
16 17 18 19 |
<v-toolbar-title>Admin Login</v-toolbar-title> <v-spacer></v-spacer> </v-toolbar> |
04e3fbc56
|
20 21 22 |
<v-card class="elevation-1 pa-1"> <v-card-text> <v-flex xs12 sm8 md8 lg8 offset-xs2> |
4413a8d93
|
23 |
<v-form ref="form" v-model="valid" lazy-validation> |
93a68cfa1
|
24 |
<v-text-field |
c1fd43e24
|
25 |
v-model="userLogincredentials.userName" |
04e3fbc56
|
26 27 28 29 |
:rules="nameRules" label="Username" required ></v-text-field> |
93a68cfa1
|
30 |
<v-text-field |
07095d4d8
|
31 |
:rules="[rules.required, rules.min]" |
c1fd43e24
|
32 |
v-model="userLogincredentials.password" |
04e3fbc56
|
33 |
:append-icon="e1 ? 'visibility_off' : 'visibility'" |
93a68cfa1
|
34 35 |
:append-icon-cb="() => (e1 = !e1)" :type="e1 ? 'password' : 'text'" |
93a68cfa1
|
36 37 |
name="input-10-1" label="Password" |
93a68cfa1
|
38 |
counter |
07095d4d8
|
39 |
|
93a68cfa1
|
40 |
></v-text-field> |
07095d4d8
|
41 |
|
04e3fbc56
|
42 |
</v-form></v-flex> |
07095d4d8
|
43 |
</v-card-text> |
04e3fbc56
|
44 |
<v-flex xs12 sm8 md8 lg8 offset-xs2> |
07095d4d8
|
45 |
<v-checkbox :label="`Remember me`" |
93a68cfa1
|
46 |
v-model="remember"></v-checkbox> |
4413a8d93
|
47 |
<h5 id="fp"> <router-link to="/forgetpassword">Forget Password</router-link></h5> |
04e3fbc56
|
48 49 50 |
</v-flex> <v-flex class="mt-3 text-md-center"> |
93a68cfa1
|
51 52 53 54 55 56 57 |
<v-btn round color="black" dark large @click="login" :loading="loading">Login</v-btn> </v-flex> </v-card> </v-flex> </v-layout> </v-container> </v-content> |
07095d4d8
|
58 59 60 |
<v-footer class="pa-4" color="grey darken-2"> </v-footer> </v-app> |
93a68cfa1
|
61 62 63 64 65 66 67 68 69 70 71 |
</template> <script> import axios from 'axios'; export default { data () { return { e1: true, loading: false, remember: false, valid: false, |
b34ed827a
|
72 |
userLogincredentials: {}, |
04e3fbc56
|
73 74 75 76 77 78 79 80 81 82 |
username: '', nameRules: [ v => !!v || 'Username is required', // v => v.length >0 ], // email: '', // erules: { // required: value => !!value || 'This email field is Required.', // em: v => (v.length > 0 && /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/.test(v) || 'Email must be valid') // }, |
07095d4d8
|
83 84 |
password: '', rules: { |
c35a8dafd
|
85 |
required: value => !!value || 'password is Required.', |
07095d4d8
|
86 87 88 |
min: v => (/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})/).test(v) && v.length >= 8 || 'Min 8 characters upper case lower case symbol required' } |
93a68cfa1
|
89 90 91 92 |
}; }, methods: { login () { |
b34ed827a
|
93 |
console.log('=clicked==', this.userLogincredentials); |
93a68cfa1
|
94 95 96 97 |
this.loading = true; setTimeout(() => { this.$router.push('/dashboard'); }, 1000); |
4413a8d93
|
98 |
} |
a259e694f
|
99 100 101 102 103 104 105 106 107 108 |
// created () { // axios.get(`http://jsonplaceholder.typicode.com/posts`) // .then(response => { // this.posts = response.data; // }) // .catch(e => { // this.errors.push(e); // }); // } |
93a68cfa1
|
109 110 |
} }; |
93a68cfa1
|
111 112 113 114 115 116 117 118 119 120 121 122 |
</script> <style scoped lang="css"> #login{ width: 100%; position: absolute; top: 0; left: 0; content: ""; z-index: 0; } </style> |
04e3fbc56
|
123 |
<style scoped> |
93a68cfa1
|
124 125 126 |
img{ position:absolute; top:13px; |
04e3fbc56
|
127 128 129 130 |
left:50px; } .v-btn--large { padding: 0px 84px; |
93a68cfa1
|
131 |
} |
04e3fbc56
|
132 133 134 135 |
#fp{ position: absolute; top: 193px; right: 128px; |
4413a8d93
|
136 |
color: black; |
04e3fbc56
|
137 |
} |
4413a8d93
|
138 139 140 |
a{ color: #696969; } |
04e3fbc56
|
141 |
|
93a68cfa1
|
142 |
</style> |