login form rules

This commit is contained in:
Jörn-Michael Miehe 2019-05-09 03:31:56 +02:00
parent 0a61d2750b
commit 366339fc9a

View file

@ -8,12 +8,14 @@
<v-text-field <v-text-field
ref="autofocus" ref="autofocus"
v-model="login" v-model="login"
:rules="loginRules"
label="User name" label="User name"
required required
></v-text-field> ></v-text-field>
<v-text-field <v-text-field
v-model="password" v-model="password"
:rules="passwordRules"
:append-icon="showPassword ? 'visibility' : 'visibility_off'" :append-icon="showPassword ? 'visibility' : 'visibility_off'"
@click:append="showPassword = !showPassword" @click:append="showPassword = !showPassword"
:type="showPassword ? 'text' : 'password'" :type="showPassword ? 'text' : 'password'"
@ -38,8 +40,11 @@ export default {
data: () => ({ data: () => ({
login: '', login: '',
loginRules: [v => !!v || 'Please enter user name'],
password: '', password: '',
showPassword: false showPassword: false,
passwordRules: [v => !!v || 'Please enter password'],
}), }),
methods: { methods: {