LoginRegister.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div id="login-register">
  3. <h2>{{ $t("materio.Please login or create a new account") }}</h2>
  4. <div class="wrapper">
  5. <section class="login">
  6. <h3>{{ $t("default.Login") }} </h3>
  7. <LoginForm @onLogedIn="onLogedIn" />
  8. </section>
  9. <section class="register">
  10. <h3>{{ $t("default.Register a new account") }}</h3>
  11. <RegisterForm @onRegistered="onRegistered" />
  12. </section>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import { mapState, mapActions } from 'vuex'
  18. import LoginForm from 'vuejs/components/Form/LoginForm'
  19. import RegisterForm from 'vuejs/components/Form/RegisterForm'
  20. export default {
  21. name: "LoginRegister",
  22. data: () => ({
  23. loginEmail:null,
  24. password:null,
  25. registerEmail:null
  26. }),
  27. props:['callbackargs', 'onLogedInBack', 'onRegisteredBack'],
  28. methods: {
  29. ...mapActions({
  30. userLogin: 'User/userLogin',
  31. userRegister: 'User/userRegister'
  32. }),
  33. onLogedIn () {
  34. // this.$emit('onLogedIn', this.callbackargs)
  35. this.onLogedInBack(this.callbackargs)
  36. },
  37. onRegistered () {
  38. // this.$emit('onRegistered', this.callbackargs)
  39. this.onRegisteredBack(this.callbackargs)
  40. }
  41. },
  42. components: {
  43. LoginForm,
  44. RegisterForm
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. fieldset{
  50. padding:0;
  51. margin:0;
  52. border:none;
  53. }
  54. </style>