2019-04-09 00:21:00 +02:00
|
|
|
<template lang="html">
|
|
|
|
<div id="block-userlogin" class="">
|
2019-05-21 14:56:34 +02:00
|
|
|
<h2>{{ title }}</h2>
|
2019-04-09 00:21:00 +02:00
|
|
|
<section>
|
|
|
|
<input
|
|
|
|
id="edit-name"
|
|
|
|
class="form-email"
|
|
|
|
type="text"
|
2019-05-21 14:56:34 +02:00
|
|
|
v-bind:placeholder="form.ph_email" name="name"
|
2019-04-09 00:21:00 +02:00
|
|
|
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"
|
2019-05-21 14:56:34 +02:00
|
|
|
v-bind:placeholder="form.ph_pass" name="pass"
|
2019-04-09 00:21:00 +02:00
|
|
|
v-model="password"
|
|
|
|
@keyup.enter="login"
|
|
|
|
/>
|
|
|
|
<button
|
|
|
|
id="edit-submit"
|
|
|
|
class="button"
|
|
|
|
@click.stop="login"
|
|
|
|
>
|
2019-05-21 14:56:34 +02:00
|
|
|
{{ form.btn_value }}
|
2019-04-09 00:21:00 +02:00
|
|
|
</button>
|
2019-05-21 14:56:34 +02:00
|
|
|
<ul>
|
|
|
|
<li><a
|
|
|
|
v-bind:href="form.register.href"
|
|
|
|
>
|
|
|
|
{{ form.register.title }}
|
|
|
|
</a></li>
|
|
|
|
<li><a
|
|
|
|
v-bind:href="form.reset.href"
|
|
|
|
>
|
|
|
|
{{ form.reset.title }}
|
|
|
|
</a></li>
|
|
|
|
</ul>
|
2019-04-09 00:21:00 +02:00
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
// https://github.com/alvar0hurtad0/drupal-vuejs-todo
|
|
|
|
import { mapState, mapActions } from 'vuex'
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
mail: '',
|
|
|
|
password: ''
|
|
|
|
}
|
|
|
|
},
|
2019-05-21 14:56:34 +02:00
|
|
|
props: ['title', 'form'],
|
2019-04-09 00:21:00 +02:00
|
|
|
computed: {
|
2019-04-10 10:47:45 +02:00
|
|
|
...mapState(['User'])
|
2019-04-09 00:21:00 +02:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions({
|
2019-05-20 18:49:31 +02:00
|
|
|
userLogin: 'User/userLogin'
|
2019-04-09 00:21:00 +02:00
|
|
|
}),
|
|
|
|
login () {
|
2019-05-20 18:49:31 +02:00
|
|
|
this.userLogin({
|
2019-04-09 00:21:00 +02:00
|
|
|
mail: this.mail,
|
|
|
|
pass: this.password
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2019-05-21 14:56:34 +02:00
|
|
|
section{
|
|
|
|
max-width:300px;
|
|
|
|
}
|
|
|
|
input{
|
|
|
|
display:block;
|
|
|
|
max-width:100%;
|
|
|
|
margin:0.5em 0 0 0;
|
|
|
|
}
|
|
|
|
button{
|
|
|
|
margin:0.5em 0 0 0;
|
|
|
|
}
|
|
|
|
ul{
|
|
|
|
margin:0; padding:0.5em 0 0 0;
|
|
|
|
}
|
|
|
|
li{
|
|
|
|
list-style:none;
|
|
|
|
margin:0.5em 0 0 0; padding:0;
|
|
|
|
font-size:0.882em;
|
|
|
|
}
|
|
|
|
a{
|
|
|
|
}
|
2019-04-09 00:21:00 +02:00
|
|
|
</style>
|