This repository has been archived on 2024-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
node-fftcg/frontend/src/components/forms/Register.vue

64 lines
1.3 KiB
Vue
Raw Normal View History

2019-05-06 14:18:23 +00:00
<template>
2019-05-06 15:02:12 +00:00
<FormDialog buttonText="Register">
<v-card-title class="headline">
2019-05-06 14:18:23 +00:00
Register
2019-05-06 15:02:12 +00:00
</v-card-title>
<v-card-text>
<v-text-field
ref="autofocus"
v-model="login"
:rules="loginRules"
label="User name"
required
></v-text-field>
<v-text-field
v-model="password"
:append-icon="showPassword ? 'visibility' : 'visibility_off'"
@click:append="showPassword = !showPassword"
:rules="passwordRules"
:type="showPassword ? 'text' : 'password'"
label="Password"
required
counter
></v-text-field>
</v-card-text>
</FormDialog>
2019-05-06 14:18:23 +00:00
</template>
<script>
2019-05-06 15:02:12 +00:00
import FormDialog from './FormDialog.vue'
2019-05-06 14:18:23 +00:00
export default {
name: 'RegisterForm',
2019-05-06 15:02:12 +00:00
components: {
FormDialog
},
data: () => ({
2019-05-06 14:18:23 +00:00
login: '',
loginRules: [v => !!v || 'User name is required'],
password: '',
showPassword: false,
passwordRules: [v => !!v || 'Password is required']
}),
methods: {
2019-05-06 15:02:12 +00:00
confirm() {
window.pkgs.axios
.post('/user/register', {
login: this.login,
password: this.password
})
.then(response => {
// this.$refs.form.reset()
console.log('register', response.data)
2019-05-06 14:18:23 +00:00
})
}
}
}
</script>