Register.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div class="modal" :class="{ 'is-active': isActive }">
  3. <div class="modal-background"></div>
  4. <div class="modal-card">
  5. <header class="modal-card-head">
  6. <p class="modal-card-title">Register</p>
  7. <button class="delete" @click="toggleModal()"></button>
  8. </header>
  9. <section class="modal-card-body">
  10. <!-- validation to check if exists http://bulma.io/documentation/elements/form/ -->
  11. <label class="label">Email</label>
  12. <p class="control">
  13. <input class="input" type="text" placeholder="Email..." v-model="$parent.$parent.register.email">
  14. </p>
  15. <label class="label">Username</label>
  16. <p class="control">
  17. <input class="input" type="text" placeholder="Username..." v-model="$parent.$parent.register.username">
  18. </p>
  19. <label class="label">Password</label>
  20. <p class="control">
  21. <input class="input" type="password" placeholder="Password..." v-model="$parent.$parent.register.password">
  22. </p>
  23. <div class="g-recaptcha" :data-sitekey="recaptcha.key"></div>
  24. </section>
  25. <footer class="modal-card-foot">
  26. <a class="button is-primary" @click="submitModal()">Submit</a>
  27. </footer>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. isActive: false,
  36. recaptcha: {
  37. key: ''
  38. }
  39. }
  40. },
  41. ready: function () {
  42. let _this = this;
  43. lofig.get('recaptcha.key', function (key) {
  44. _this.recaptcha.key = key;
  45. });
  46. },
  47. methods: {
  48. toggleModal: function () {
  49. this.isActive = !this.isActive;
  50. },
  51. submitModal: function () {
  52. this.$dispatch('register');
  53. this.toggleModal();
  54. }
  55. }
  56. }
  57. </script>