2019-04-09 00:21:00 +02:00
|
|
|
<template lang="html">
|
|
|
|
<div id="block-userlogin" class="">
|
|
|
|
<h2>Login Hello!</h2>
|
|
|
|
<section>
|
|
|
|
<input
|
|
|
|
id="edit-name"
|
|
|
|
class="form-email"
|
|
|
|
type="text"
|
|
|
|
placeholder="Email" name="name"
|
|
|
|
v-model="mail"
|
2019-04-10 10:47:45 +02:00
|
|
|
@keyup.enter="login"
|
|
|
|
/>
|
2019-04-09 00:21:00 +02:00
|
|
|
<input
|
|
|
|
id="edit-pass"
|
|
|
|
class="form-text"
|
|
|
|
type="password"
|
|
|
|
placeholder="Password" name="pass"
|
|
|
|
v-model="password"
|
|
|
|
@keyup.enter="login"
|
|
|
|
/>
|
|
|
|
<button
|
|
|
|
id="edit-submit"
|
|
|
|
class="button"
|
|
|
|
@click.stop="login"
|
|
|
|
>
|
|
|
|
login
|
|
|
|
</button>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
// https://github.com/alvar0hurtad0/drupal-vuejs-todo
|
|
|
|
|
|
|
|
import { mapState, mapActions } from 'vuex'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
mail: '',
|
|
|
|
password: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
2019-04-10 10:47:45 +02:00
|
|
|
...mapState(['User'])
|
2019-04-09 00:21:00 +02:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions({
|
|
|
|
getToken: 'User/getToken'
|
|
|
|
}),
|
|
|
|
|
|
|
|
// usernameInputHandler(input) {
|
|
|
|
// this.username = input;
|
|
|
|
// },
|
|
|
|
// passwordInputHandler(input) {
|
|
|
|
// this.password = input;
|
|
|
|
// },
|
|
|
|
|
|
|
|
login () {
|
|
|
|
this.getToken({
|
|
|
|
mail: this.mail,
|
|
|
|
pass: this.password
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
</style>
|