LoginRegister.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <div id="login-register">
  3. <h2>{{ $t(header) }}</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:{
  28. header: {
  29. type: String,
  30. default: 'materio.Please login or create a new account'
  31. },
  32. callbackargs: Object,
  33. onLogedInBack: Function,
  34. onRegisteredBack: Function
  35. },
  36. methods: {
  37. ...mapActions({
  38. userLogin: 'User/userLogin',
  39. userRegister: 'User/userRegister'
  40. }),
  41. onLogedIn () {
  42. // this.$emit('onLogedIn', this.callbackargs)
  43. this.onLogedInBack(this.callbackargs)
  44. },
  45. onRegistered () {
  46. // this.$emit('onRegistered', this.callbackargs)
  47. this.onRegisteredBack(this.callbackargs)
  48. }
  49. },
  50. components: {
  51. LoginForm,
  52. RegisterForm
  53. }
  54. }
  55. </script>
  56. <style lang="scss" scoped>
  57. fieldset{
  58. padding:0;
  59. margin:0;
  60. border:none;
  61. }
  62. </style>